Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
If you don't need to use awk, paste could work:
$ paste -d $'\n''\n' <fileB fileA - - - | tr -s $'\n''\n' >fileC
The tr part isn't strictly necessary, so you can remove it if you don't mind extra newlines.
tr
$ paste -d $'\n' <fileB fileA - - - | tr -s $'\n' >fileC
$ paste -d '\n' <fileB fileA - - - | tr -s '\n' >fileC
$ cat fileB | paste -d $'\n' <fileB fileA - - - | tr -s $'\n' >fileC
$ cat fileB | paste -d $'\n' fileA - - - | tr -s $'\n' >fileC
The tr part isn't strictly necessary, so you can remove it if you don't mind a couple of extra trailing newlines.
The tr part isn't necessary, so you can remove it if you don't mind a couple of extra trailing newlines.