开发者

problem with awk print

开发者 https://www.devze.com 2023-01-21 13:26 出处:网络
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 :

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
0

精彩评论

暂无评论...
验证码 换一张
取 消