[CLUE-Tech] shell programming

Marcin marbej at wp.pl
Wed Dec 11 10:10:47 MST 2002


> >
> > #!/bin/bash
> >
> > if [ $LOGNAME = "root" ]; then
> >   echo "Hello root"
> > else
> >   echo "You aren't root"
> > fi
> >
> >
> > Will do what you want.Q
>
> Not with my bash ...  $LOGNAME does not change when you `su
>
> [davep at ldpx:~/images]$ su
> [root at ldpx images]# echo $LOGNAME
> davep
>

But if you put "su -" it works !
Try this:

[davep at ldpx:~/images]$ su -
[root at ldpx images]# echo $LOGNAME
root

-- 
Greetings from Poland,
Marcin Betlej
e-mail: marbej at wp.pl



More information about the clue-tech mailing list