WOT: Scripting Question[Scanned]
Mikkel L. Ellertson
mikkel at infinity-ltd.com
Thu Jul 27 22:27:51 UTC 2006
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.
Mikkel
--
Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!
More information about the users
mailing list