oneliner bash question

gabriel danstemporaryaccount-FFYn/CNdgSA= at public.gmane.org
Mon Apr 19 14:36:46 UTC 2004


On April 19, 2004 10:20 am, Jing Su wrote:
> >   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)}'

thanks! it worked.

-- 
...he who in dealing with the empire loves his subjects as one should love 
one's body is the best person to whom one can commit the empire.
  - lau tzu, "tao te ching: chapter xiii"

--
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