Summary: $HOME environment

From: Wianecki, Christopher <Christopher.Wianecki_at_sothebys.com>
Date: Fri Dec 12 2003 - 14:17:18 EST
Thanks so much for quick response, D. Collier suggested to put \ in front of
$HOME, it does work now, thank you so much.

Chris


-----Original Message-----
From: D. Collier [mailto:dcollier@ghis.hmsy.com] 
Sent: Friday, December 12, 2003 2:08 PM
To: Wianecki, Christopher
Subject: [] Re: $HOME environment


On Friday 12 December 2003 11:01 am, Wianecki, Christopher wrote:

> When I do try to echo $HOME running the same I get $HOME for the current
> user. How can I get the $HOME directory environment from the user I would
> like to run script as?
>
> % su - interface -c "echo $HOME"
> Sun Microsystems Inc.   SunOS 5.8       Generic February 2000
> /cw
> $

Your root shell is expanding the $HOME variable before the 'su' command 
executes, so effectively you're asking su to execute "echo /cw".

You need to escape the $.  For example:

su - interface -c "echo \$HOME"

-- 
D. Collier


www.sothebys.com
**********************************************************************
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Fri Dec 12 14:17:07 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:25 EST