How can shell scripts be shared by different shells?

Paul Falstad pfalstad at phoenix.Princeton.EDU
Sun Apr 7 04:35:11 AEST 1991


andy at syma.sussex.ac.uk (Andy Clews) wrote:
>Does anyone know of any clever kludges that can be made to this central
>shellfile, which could allow Ksh or Csh to be able to source it? I thought
>of putting a test at the top, but of course tests are different in Csh
>and Ksh.....

Do something like this:

export PATH && . kshscript && exit
source cshscript

Then create two files named 'kshscript' and 'cshscript' with appropriate
commands in each.  Or, just include the csh commands after the 'export'
line.

Why can't you just have two separate shellfiles, one for csh users and one
for ksh users, and just have each person source/. the appropriate file?

--
Paul Falstad, pfalstad at phoenix.princeton.edu | 10 PRINT "PRINCETON CS"
[Your blood pressure just went up.]          | 20 GOTO 10
Princeton University would like to apologize to everyone for this article.



More information about the Comp.unix.questions mailing list