Nicola Lodato wrote:
> I've a user /test /that has a /bin/bash shell. In his .profile file 
> there is these lines:
> ODSRELEASE=/some/dir/
> export ODSRELEASE
> 
> When, as user root, I try this command:
> 
> su - test -c "echo $ODSRELEASE"

You are getting confused about shell command line quoting.  The
$ODSRELEASE is getting expanded by *your* shell inside the double
quotes and the sub-shell is never even getting the query.  It is only
seeing an empty echo command.

Try this instead.

  su - test -c 'echo $ODSRELEASE'

or

  su - test -c "echo \$ODSRELEASE"

Use 'echo' again to see what the expansion of the command line looks
like.

  echo su - test -c "echo $ODSRELEASE"
  echo su - test -c 'echo $ODSRELEASE'
  echo su - test -c "echo \$ODSRELEASE"

Bob


_______________________________________________
Bug-sh-utils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-sh-utils

Reply via email to