From: Moody on 26 May 2010 01:39 \w|while read line do echo "Line is $Line" done above snippet of script does work very well but it doesn't show complete lines/arguments of w command's output. like normally I get smith pts/25 10.10.1.3 11:16 4:33 0.05s 0.04s ssh -l teether busybox and with above script I get only: smith pts/25 10.10.1.3 11:16 4:33 0.05s 0.04s ssh -l teeth all lines from my script show lines of equal width Any help. Regards, BB
From: Barry Margolin on 26 May 2010 03:15 In article <9431f0db-13a8-422d-9e2c-dcf438bb4711(a)c22g2000vbb.googlegroups.com>, Moody <nasir.mahmood(a)gmail.com> wrote: > \w|while read line > do > echo "Line is $Line" > done > > above snippet of script does work very well but it doesn't show > complete lines/arguments of w command's output. > > like normally I get > > smith pts/25 10.10.1.3 11:16 4:33 0.05s 0.04s ssh -l > teether busybox > > and with above script I get only: > > smith pts/25 10.10.1.3 11:16 4:33 0.05s 0.04s ssh -l teeth > > all lines from my script show lines of equal width > > Any help. > > Regards, > BB It sounds like your version of the "w" command alters its output format depending on whether it's writing to a terminal or not. Check the man page to see if there's an option that overrides this behavior. -- Barry Margolin, barmar(a)alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***
|
Pages: 1 Prev: copy files Next: How to remove the first 5 characters from a string? |