> Oh, I should mention, awk '{ print $3 }' is far from ideal, but works
> in most cases for me. A safer variant would be to get appl.id as:
>
> awk '{ print substr($0, 24, 5) }'
>
> not sure if substr is avalible for all awk though
Out of curiosity, why is "print $3" bad? And is it any worse than
using substr?
To me, substr is worse, because now you're dependent on columns lining
up properly. Whereas using $3 will always work unless IBM changes the
columns in the list (either adds/removes or changes order).
Lennart - 26 Oct 2007 06:18 GMT
> > Oh, I should mention, awk '{ print $3 }' is far from ideal, but works
> > in most cases for me. A safer variant would be to get appl.id as:
[quoted text clipped - 5 lines]
> Out of curiosity, why is "print $3" bad? And is it any worse than
> using substr?
Sometime the second column (Appl name) is all spaces. print $3 in
those cases will spit out Application id instead
> To me, substr is worse, because now you're dependent on columns lining
> up properly. Whereas using $3 will always work unless IBM changes the
> columns in the list (either adds/removes or changes order).
See above. Anyhow, I just wanted to point out that print $3 might
fail. For me print $3 works frequently enough, but it might not be the
case for the OP.
/Lennart