On Thu, 20 Mar 2003, Post, Mark K wrote:
> Because most of us don't work for ISV's that support products on UNIX as
> well as Linux, and any script we write will only be running on Linux? I
> frequently code my scripts that way because I want them to be treated as
> bash scripts and not sh scripts.
Linux is about freedom.
To paint yourself into a corner with that which made you free is
terribly short sighted (or perhaps reactionary?). It is counter.
There's little (but some) value is what you're suggesting, Mark.
Shell scripting is bad enough. (Some might call it a write-only
language. And C-Shell is worse than Bourne variants, documented.)
If you want to use BASH extensions, that's *fine*. The thread
started with something like "how do I get these SESSION values
established?" [my paraphrase; perhaps I am wrong there too].
Summary of what I recommend in this:
* avoid specific shell (BASH, ZSH, whatever) requirements
in your scripting, unless you clearly need them
* put session settings into .profile and .xinitrc,
or (better) have both of those source
a common profile, eg: $HOME/etc/profile
* append or prepend to vars like PATH, as most of us
recognize, rather than resetting those vars
* only put INVOKATION settings (things like 'alias'
which cannot be inherited) into .bashrc or other
.xxxxrc files, and do not append/append/append
(as with PATH) in an invokation profile like .bashrc
I suppose that is a lot of chalk talk,
and I hope I haven't lost the audience.
-- RMT