Re: WOT: Scripting Question[Scanned]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Alexander Dalloz wrote:
> for i in $(qwinsta /SERVER:servername | awk '/Disc/ {print $3}')
>    do rwinsta /SERVER:servername ${i}
> done
With the extra space is the value in the first field in at least
some of the data, the number field will be ether $3 or $2. For data
that has each data field in a fixed position on the line, like the
old punch cards did, I find that the --byte option of cut usually
works better. But you do have to get rid of the extra spaces -
usualy at the end of text fields, and the start of numeric fields.
But if you are doing something like:

for i in $(cut -b 38-45 test.txt) ; do <some commands> ; done

then is is not a problem. The extra spaces in the number are discarded.


  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux