Jon Bringhurst on 22 Jan 2009 11:22:55 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] What is my current shell?


Perhaps something like...

 grep `whoami` /etc/passwd | awk -F':' '{print $7}'

-Jon

On Thu, Jan 22, 2009 at 2:16 PM, TuskenTower <tuskentower@gmail.com> wrote:
> All,
> We have an oddball problem.  Is there any portable way to determine
> what shell you are using once you are inside a script?
>
> Right now, we are thinking of using
> which `echo $0`
>
> As you can see here, $SHELL does not change when you switch shells.
> [2:07pm] [shaha:pts/8] [shaha] : /gtc/staff/shaha/work/sortT > echo $SHELL
> /usr/local/bin/tcsh
> [2:08pm] [shaha:pts/8] [shaha] : /gtc/staff/shaha/work/sortT > bash
> shaha@shaha:~/work/sortT$  echo $SHELL
> /usr/local/bin/tcsh
>
> This is for problems at customer sites where they are using the wrong
> Bourne shell on Solaris (/bin/sh) when we want them to use
> /usr/xpg4/bin/sh.
>
> thanks,
> Amul
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
>
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug