Unix shell trick: setting environment variables

In sh and bash, the syntax is VARIABLE=VALUE; export VARIABLE (in bash also export VARIABLE=value), in csh and tcsh setenv VARIABLE VALUE. Apparently csh only likes capitalized variable names.

However, you cannot use these commands in a script, and call the script to set the environment variables, unless you call it with source, or (in sh and bash) you prefix the export line with ". " (dot space).

Dec 18, 2003

setpath (/progtricks)
2003-12-18, 14:39 [edit]

  Login:   Password:   [rss] [cc] [w3] [css]

© M. Vallisneri 2012 — last modified on 2010/01/29

Tantum in modicis, quantum in maximis