0

I am having a problem printing something using the awk command on Linux. I have a file and i use the following line:

x="something";awk -v x="$x" '{print $0,x}' myfile.txt

I want to print the whole file ($0) and then at the end of every line the x variable. However this x variable for some reason goes at the beginning of the file and not at the end. This is a sample of my file and the output.

enter image description here

I don't know what is the problem but it is really getting on my nerves!! Thanks!!

Cyrus
  • 84,225
  • 14
  • 89
  • 153
fizz fish
  • 41
  • 5

0 Answers0