HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] How to set Environment variables



On Wednesday 19 July 2006 13:25, Gunjan Gupta wrote:
> Hi to all,
> Can any body tell me where I can find out these variables and how to set
> it?

(assuming you are using the Bourne shell)

You can find out the present values of environment variables using
$ env
or
$ export -p

You can set new variables just by defining them;
$ DOG="alsatian"
$ echo $DOG
prints alsatian.
However, this is only valid for the current shell.
$ sh
starts a new shell process  (and your prompt may well change);  this time
$ echo $DOG
prints a blank line.  (press ctrl+D to exit the second shell.)

To cause a variable to be defined within subshells you need to export it.
$ export DOG
$ sh
$ echo $DOG
prints alsatian.  (press ctrl+D again.)

You can also define and export a variable in one go;
$ export CAT="persian"
$ echo $CAT
$ sh
$ echo $CAT
prints persian  (press ctrl+D again.)

You can also define a variable and start a subshell in one go;
$ CAT="burmese" sh
$ echo $cat
prints burmese  (press ctrl+D)
echo $cat
prints persian


For more information, please look at any textbook on unix shell scripting.

--
AJS

____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*




Project hosted by iFAX Solutions