Search code examples
linuxbashshellcat

bash cat multiple files


I am trying to cat three files and obtain and insert a newline \n after each file ,I thought of using something like :

cat f1 f2 f3|tr "\EOF" "\n"

without success.

What is the easiest way to achieve that ?


Solution

  • cat f1 <(echo) f2 <(echo) f3 <(echo) 
    

    or

    perl -pe 'eof&&s/$/\n/' a b c