[sf-lug] shell, man(1) [was: path name expansion]

jim jim at well.com
Sat Aug 20 10:19:30 PDT 2016


$ echo $SHELL $SHLVL
/bin/bash 1
$ dash
$ echo $SHELL $SHLVL
/bin/bash 1

Tne dash shell does not set the SHELL or
the SHLVL variables. I tried to create
an if-fi structure in ~/.profile to
force the change but failed.




On 08/20/2016 03:59 PM, Alex Kleider wrote:
> On 2016-08-19 11:13, Michael Paoli wrote:
>
>
>> If it's lines you're counting, can certainly be done in one line:
>> $ mkdir Dir{A..C} && touch Dir{A..C}/file{1..3}
>
> Commands, not lines; my slopyness in using one rather than the other.
>
>>
>> $ type set
>> set is a shell builtin
>> $ ls -l /proc/$$/exe
>> lrwxrwxrwx 1 michael users 0 Jul 10 16:09 /proc/7940/exe -> /bin/bash
>> $ man bash
>> ...
>> set [--abefhkmnptuvxBCEHPT] [-o option-name] [arg ...]
>> set [+abefhkmnptuvxBCEHPT] [+o option-name] [arg ...]
>>        Without options, the name and value of each shell variable  are
>>        displayed in a format that can be reused as input for setting or
>>        resetting the currently-set variables.  Read-only variables can-
>>        not  be  reset.  In posix mode, only shell variables are listed.
>>        The output is sorted according  to  the  current locale.   When
>>        options  are specified, they set or unset shell attributes.  Any
>>        arguments remaining after option processing are treated as  val-
>>        ues for the positional parameters and are assigned, in order, to
>>        $1, $2, ...  $n.  Options,  if  specified,  have  the following
>>        meanings:
>> ...
>> $ printenv | grep SHELL | grep -v '^XT'
>> SHELL=And why would you think this tells you the shell you're running?
>> $
>> What SHELL is set to in the environment, and the shell one is running,
>> are not necessarily the same ... hopefully obvious by my example
>> above.
>
> Not obvious to me at all, I must confess.
> printenv and set do not appear to be doing the same thing.
> alex at X301n3:~/Test$ printenv | grep SHELL | grep -v '^XT'
> SHELL=/bin/bash
> alex at X301n3:~/Test$ set | grep '^BASH_VERSION='
> BASH_VERSION='4.3.11(1)-release'
> alex at X301n3:~/Test$ printenv | grep '^BASH_VERSION='
>
> I don't understand the grep -v '^XT' part.
>
> ak
>
>
> _______________________________________________
> sf-lug mailing list
> sf-lug at linuxmafia.com
> http://linuxmafia.com/mailman/listinfo/sf-lug
> Information about SF-LUG is at http://www.sf-lug.org/
>





More information about the sf-lug mailing list