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

Re: Shell Scripts



%% Art Edwards <edwardsa@icantbelieveimdoingthis.com> writes:

  ae> source ~/.cshrc

You don't need this.  csh (and tcsh) always source your .cshrc file by
default (this is another good reason it's a bad idea to use csh for
scripting... consider: what if someone else tries to use the script and
has something different in their .cshrc that breaks your script?  If you
have to use csh you should at least use the -f flag: #!/bin/tcsh -f).

  ae> I've also written the script so that it doesn't need my set of
  ae> aliases.  However, it simply does not ls the same way as tcsh or
  ae> csh.  I can run bash scripts from within tcsh by placing

You don't say what "the same way" is.  What exactly is it doing
differently?  Note that interactive shell scripts often behave
differently in various ways than non-interactive shell scripts: command
line editing doesn't work in non-interactive scripts.  I don't remember
much about csh because I've used Bourne shells ever since I discovered
how awful csh syntax was, but maybe some of the aliases etc. don't work
the same way in non-interactive shells.

Also note that ~/.login is NOT sourced by shell scripts at all, so if
the stuff you're looking for is in ~/.login you'll have to source that
directly.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@nortel.com>           HASMAT--HA Software Mthds & Tools
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.



Reply to: