[sf-lug] shell, man(1) [was: path name expansion]
Michael Paoli
Michael.Paoli at cal.berkeley.edu
Fri Aug 19 11:13:51 PDT 2016
> From: "Alex Kleider" <akleider at sonic.net>
> To: Michael Paoli <Michael.Paoli at cal.berkeley.edu>
> Cc: SF-LUG <sf-lug at linuxmafia.com>
> Subject: Re: [sf-lug] path name expansion
> Date: Fri, 19 Aug 2016 10:16:16 -0700
> On 2016-08-19 04:05, Michael Paoli wrote:
>> e.g.:
>> $ ls
>> $ mkdir Dir{A..C}
>> $ touch Dir{A..C}/file{1..3}
>
> Nice- does just what I wanted- just that it takes two lines rather than one.
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}
>> $ ls -l /proc/$$/exe
> alex at X301n3:~/Test$ ls -l /proc/$$/exe
> lrwxrwxrwx 1 alex alex 0 Aug 16 07:51 /proc/6601/exe -> /bin/bash
>
>> $ set | grep '^BASH_VERSION='
> alex at X301n3:~/Test$ man set
> No manual entry for set
> alex at X301n3:~/Test$ which set
> alex at X301n3:~/Test$ file set
> set: ERROR: cannot open `set' (No such file or directory)
> The command 'set' seems not to be available on my system but:
> alex at X301n3:~/Test$ printenv | grep '^BASH_VERSION='
> alex at X301n3:~/Test$ printenv | grep SHELL
> SHELL=/bin/bash
> makes your point.
$ 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.
More information about the sf-lug
mailing list