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

Re: Portable shell scripts

csj wrote:
> Is there a way to write portable shell scripts.  In particular,
> I've problems with built-ins setenv (tcsh) and export (bash).
> How do I define variables in tcsh and have them usable in bash
> too?

Your best option is "#!/bin/sh" at the top of all of your scripts.
Then you will always have a consistent syntax.  By your posting it
sounds to me like you have not been putting a #! line in your scripts
and have been taking "post-luck" over whatever shell the user is
running at the moment.  That will cause you no end of grief.


Reply to: