Shell command not working as expected -


i trying write shell command append ',' @ end of each line , output result new file. have written following code-

 sed -e 's/$/,/g' -e '$ s/,$//' name.txt > output 

the above code executes , places comma operator in new line, i.e. if input file is

aabbcc ddeeff 

the output shown is-

aabbcc , ddeeff 

instead of

aabbcc, ddeeff 

what changes should make expected output ? tried

awk '{print $0","}' name.txt > output 

but displays output file above.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -