• notice
  • Congratulations on the launch of the Sought Tech site

The shell command adds characters to the front and back of each line in the file

  1. How the shell inserts characters at the beginning of each line in a file:

    awk '{print "xxx"$0}' fileName
  2. How the shell inserts characters at the end of each line in a file:

    awk '{print $0"xxx"}' fileName
  3. How the shell inserts characters into the specified column of each line in a file:

    awk '$O=$O" xxx"' fileName
  4. To insert characters before and after each line in a file at once:

    awk '{print "xxx"$0"yyy"}' fileName


Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+