This is a discussion on run script error within the Linux Administration forums, part of the Linux Forums category; I try to run a new script on the RH linux shell , it always pop the sign "##4" ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I try to run a new script on the RH linux shell , it always pop the
sign "##4" to each line , but I can run the same script on other shell , what is wrong in my system ? please suggest , thx in advance. #!/bin/bash who -u awk '{ print $6":"$7 }' grep -v '\.' |
|
|||
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 Andy wrote: > I try to run a new script on the RH linux shell , it always pop the > sign "##4" to each line , but I can run the same script on other shell > , what is wrong in my system ? please suggest , thx in advance. > > #!/bin/bash > who -u awk '{ print $6":"$7 }' grep -v '\.' Well, first off, if this is the script you run, then you have a very non-standard version of the who(1) binary. On my system (admittedly, Slackware Linux 9.0), who(1) doesn't take arguments like "awk" or "grep". So, is this truely the script you run, or are there typos in the above? Assuming that there are typos in the script you presented, and you /meant/ to present us with something like #!/bin/bash who -u | awk '{ print $6":"$7 }' | grep -v '\.' then your version of who(1) still doesn't match up with what I have. When I run 'who -u', I get 6 fields back, but your script is explicitly looking for seven fields (the awk(1) portion uses $6 and $7, the sixth and seventh field respectively). Could you show us the results of: 1) who -u 2) who -u | awk '{ print $6":"$7 }' 3) who -u | awk '{ print $6":"$7 }' | grep -v '\.' This might help determine what it is you see, and how it gets derived. - -- Lew Pitcher Master Codewright & JOAT-in-training | GPG public key available on request Registered Linux User #112576 (http://counter.li.org/) Slackware - Because I know what I'm doing. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBPHcZagVFX4UWr64RAoElAJ9M1j0BV7KkrZC0OUu1Mt gKEMQJpACgyz9/ olimeYNS0pICWiFmtmBly3I= =m6iP -----END PGP SIGNATURE----- |