run script error

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" ...


Go Back   Usenet Forums > Linux Forums > Linux Administration

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-06-2004
Andy
 
Posts: n/a
Default run script error

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 '\.'
Reply With Quote
  #2 (permalink)  
Old 09-06-2004
Lew Pitcher
 
Posts: n/a
Default Re: run script error

-----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-----
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 02:34 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0