RE: why is grep behaving this way ?

2007-03-05 Thread Kevin Ross
Yes, There are lots of alternatives like : who | grep `id -un` who | grep bhasker or even i tried to do this !!! who a grep `logname` a that WORKS ONLY this command who | grep `logname` does not work ! WHY ? Here's another workaround: NAME=`logname`;who|grep $NAME

Re: why is grep behaving this way ?

2007-03-05 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/05/07 12:47, Kevin Ross wrote: Yes, There are lots of alternatives like : who | grep `id -un` who | grep bhasker or even i tried to do this !!! who a grep `logname` a that WORKS ONLY this command who | grep `logname`

why is grep behaving this way ?

2007-03-02 Thread Bhasker C V
I have logname command give me this output [EMAIL PROTECTED] ~]$ logname bhaskerv and say i execute this command [EMAIL PROTECTED] ~]$ echo `logname` bhaskerv till this it is all fine BUT [EMAIL PROTECTED] ~]$ who | grep `logname` logname: no login name Usage: grep [OPTION]... PATTERN

Re: why is grep behaving this way ?

2007-03-02 Thread Salvatore Iovene
On Fri, Mar 02, 2007 at 03:07:37PM +0530, Bhasker C V wrote: [EMAIL PROTECTED] ~]$ who | grep `logname` logname: no login name Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. Weird. Consiedering that this works: who | grep `whoami` Where's the catch? --

Re: why is grep behaving this way ?

2007-03-02 Thread HÃ¥kon Alstadheim
Salvatore Iovene wrote: On Fri, Mar 02, 2007 at 03:07:37PM +0530, Bhasker C V wrote: [EMAIL PROTECTED] ~]$ who | grep `logname` logname: no login name Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. Weird. Consiedering that this works: who |

Re: why is grep behaving this way ?

2007-03-02 Thread Matus UHLAR - fantomas
On Fri, Mar 02, 2007 at 03:07:37PM +0530, Bhasker C V wrote: [EMAIL PROTECTED] ~]$ who | grep `logname` logname: no login name Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. On 02.03.07 11:27, H?kon Alstadheim wrote: I'm running SuSE, and can

Re: why is grep behaving this way ?

2007-03-02 Thread Michael Marsh
On 3/2/07, Matus UHLAR - fantomas [EMAIL PROTECTED] wrote: I'd say that logname detects logged user by checking terminal of stdin file handle... Yup: $ echo | strace -o'|grep readlink' logname readlink(/proc/self/fd/0, pipe:[5242235], 511) = 14 $ strace -o'|grep readlink' logname

Re: why is grep behaving this way ?

2007-03-02 Thread Bhasker C V
Yes, There are lots of alternatives like : who | grep `id -un` who | grep bhasker or even i tried to do this !!! who a grep `logname` a that WORKS ONLY this command who | grep `logname` does not work ! WHY ? On Fri, 2007-03-02 at 12:16 +0200, Salvatore Iovene wrote: On Fri, Mar

Re: why is grep behaving this way ?

2007-03-02 Thread Mike McCarty
Bhasker C V wrote: Yes, There are lots of alternatives like : who | grep `id -un` who | grep bhasker or even i tried to do this !!! who a grep `logname` a that WORKS ONLY this command who | grep `logname` does not work ! WHY ? Most likely because logname misbehaves when stdin

Re: why is grep behaving this way ?

2007-03-02 Thread cga2000
On Fri, Mar 02, 2007 at 04:37:37AM EST, Bhasker C V wrote: I have logname command give me this output [EMAIL PROTECTED] ~]$ logname bhaskerv and say i execute this command [EMAIL PROTECTED] ~]$ echo `logname` bhaskerv till this it is all fine BUT [EMAIL