Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7633101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:47:24+00:00 2026-05-31T06:47:24+00:00

In linux bash, how can we concatenate files with padding on 4-byte boundary. I

  • 0

In linux bash, how can we concatenate files with padding on 4-byte boundary. I have 3 files a.txt, b.txt, c.txt, and want to concatenate them to create d.txt, each element file is started on 4-byte boundary.

a.txt: 1 byte
b.txt: 2 bytes
c.txt: 4 bytes

d.txt should be
0-3: a.txt
4-7: b.txt
8-11: c.txt

Any suggestions are appreciated.
Thanks and Best Regards,
Dien

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T06:47:25+00:00Added an answer on May 31, 2026 at 6:47 am
    for i in {a..c}.txt
    do
        cat $i
        head -c $(((4-$(stat -c %s $i)%4)%4)) /dev/zero
    done >d.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using linux and bash I have two files filea.wav and fileb.wav which are
I'm not too familiar with Linux/Bash, so I can't really find the right terms
Is there a Linux utility or a Bash command I can use to sort
I'm writing a few little bash scripts under Ubuntu linux. I want to be
I have a FreeBSD box with Bash set up. I'm used to Debian Linux
How can I write a Linux Bash script that tells me which computers are
Working in bash under Linux ubuntu 10 here I have Bash script that reads
I have around 230 files which are *.pl , *.txt and some are *.conf
Bash 4 on Linux ~ I have an array of possible values. I must
I have a perfectly functioning perl script (written in bash terminal on debian linux)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.