nanog mailing list archives

Re: processing passwords?


From: Jay Ashworth <jra () baylink com>
Date: Tue, 16 Oct 2012 21:56:20 -0400 (EDT)

----- Original Message -----
From: "Jean-Pierre A. Radley" <appl () jpr com>


| $ JRA=test echo $JRA
|
| does not work in the superficially obvious manner, but it makes
| sense
| after I think about it -- it's like trying to use sudo with
| redirection.
|
| That behavior is documented back to the v7 shell, I'm pretty sure,
| though
| my v7 UPM is at home.
|

Your shell isn't behaving like mine, in that case. I start out in tcsh
and:

jpradley:appl 6 sh
$ unset JPR
$ JPR=test echo $JPR

$ echo $JPR
test

tcsh, not especially to my surprise, does not meet the SVID or POSIX, then.

_Unix Shell Programming_, Kochan and Wood, 1985, Hayden, p 251:

"Another Way To Pass Variables To A Subshell

If you want to send the value of a variable to a subshell, there's another
way to do it besides setting the variable and then exporting it.  On the
command line, you can precede the name of the command with the assignment 
of as many variables as you want.  For example:

  DBHOME=/unx2/data DBID=452 dbrun

places the variables DBHOME and DBID, and their indicated values, into the
environment of dbrun, and then dbrun gets executed.  *These variables will
not be known to the current shell; they're created only for the execution 
of dbrun.*"

(Emphasis mine).

Cheers,
-- jra
-- 
Jay R. Ashworth                  Baylink                       jra () baylink com
Designer                     The Things I Think                       RFC 2100
Ashworth & Associates     http://baylink.pitas.com         2000 Land Rover DII
St Petersburg FL USA               #natog                      +1 727 647 1274


Current thread: