Re: simple Q a/b '$HOME', etc.
On Thu, Jul 19, 2001 at 09:32:41PM -0700, Osamu Aoki wrote:
> On Fri, Jul 20, 2001 at 12:21:58AM -0400, R1nso13@aol.com wrote:
> ...
> > so what is this method of referring to things called? and is there somewhere
> > i can find a list of all of the "$_____" things out there?
>
> $ set |less
>
> will print all environment values and functions.
correct me if i'm wrong, but i'd like to correct you because i
think that's not quite right.
set
will show all variables, /including/ environment variables.
(environment variables are those that will be visible to
sub-processes -- that is, commands run from this shell,
forked off as children; local variables will not be visible to
the kiddies.)
printenv
shows /only/ the environmental variables, without any local vars
to clutter the results. consider:
$ HERE=this
$ export THERE=that
$ set | grep HERE
HERE=this
THERE=that
$ bash
here we have a new sub-shell, a child of the original:
$ set | grep HERE
THERE=that
$ exit
now we're back to the parent shell:
$ printenv | grep HERE
THERE=that
$ set | grep HERE
HERE=this
THERE=that
okay, that was my nit for today.
--
to answer the original question--
you can use whatever veriables you need, for your own purposes:
$ plith=`ls -l`
$ green-bay-packers=`wc /usr/share/dict/words`
but for the variables that already mean something to the shell
itself, see the manpage for your shell:
man bash
man tcsh
man zsh
and look for 'Shell Variables' or something similar. other
programs will expect different variables (postgres will look for
PG_DATA for example).
--
DEBIAN NEWBIE TIP #66 from Will Trillich <will@serensoft.com>
:
Do you know WHICH SHELL YOU'RE RUNNING? If not, you can find out:
ps T
and the first item listed is most likely to be your shell.
(Valid shells are listed in /etc/shells.) The default user shell
for Debian is bash, which you can learn about via "man bash".
Also see http://newbieDoc.sourceForge.net/ ...
Reply to: