| Billy Patton 2005-05-19, 5:52 pm |
| On Thu, 19 May 2005, Billy Patton wrote:
> I have a 5k+ lines of tcsh file taht I use to set many environment variables.
> The majority is pod documentation.
>
> At the top of the file I have
> #!/bin/tcsh -f
> I use tcsh because some of the variables are more than 22 chars long.
> csh will set them but it doesn't like to print them
> I would like to be able to source this file to either a csh
> source my_init
> or
> to include into a sh with a
> . my_file
> The problem being the switch statement and the setenv in csh syntax.
> I dont want to maintain 2 seperate file but would do something more easily
> visable, even if it ment doubling the size of the file
>
> I now have this:
>
> setenv ABC cats_dogs_pigs
>
> What I would like to have is
>
> if ( shell == sh ) then
> export ABC=cats_dogs_pigs
> else
> setenv ABC cats_dogs_pigs
> endif
>
> But the syntax above is csh if/then/else
>
>
> So how can csh and sh syntax co-exist in the same file?
> csh is too deeply rooted to just drop and pick up sh.
>
>
> ___ _ ____ ___ __ __
> / _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
> / _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
> /____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
> /___/ Texas Instruments ASIC Circuit Design Methodology Group
> Dallas, Texas, 214-480-4455, b-patton@ti.com
>
___ _ ____ ___ __ __
/ _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
/ _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodology Group
Dallas, Texas, 214-480-4455, b-patton@ti.com
|