oneliner bash question

Jing Su jingsu-26n5VD7DAF2Tm46uYYfjYg== at public.gmane.org
Mon Apr 19 14:20:48 UTC 2004


>   ssh $host "du -sh "$path/$file | awk '{print $1}'"
>
> but the problem is that tihs prints out "12M\n" and i'd like to remove the
> "\n".  i tried this:

The "print" command in AWK is giving you the newline. try replacing the
awk command with:

awk '{printf("%s", $1)}'


--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list