problem with awk print
Hi guys I want to prin开发者_如何学Got in awk line and character ' after the line, but awk put the character in the middle of the line. Here is my code :
awk -v d="'" {print $0 d}
i am using bash2 thanks for help
Use dos2unix on your file, and try the command again.
Or do something like this
awk -v d="'" '{gsub(/[[:space:]]/,"");print $0 d }' file
Try:
awk -v d="'" '{print $0 d }'
Note the single quotes around the command.
Try this:
awk '{print $0 "\x27"}' file.txt
精彩评论