[X-Unix] BASH problem?

Brian Medley bpm-list-osx-unix at 4321.tv
Tue Dec 7 17:50:18 PST 2004


On Tue, Dec 07, 2004 at 05:47:01AM -0600, Russell McGaha wrote:

> 	In an effort to start learning Bash I change my shell from Tcsh to 
> Bash, but that's caused a problem.  I've a script that runs nightly to 
> pull and build Mozilla, the script is a Tcsh script with a first line 
> of "#!/bin/tcsh -x".  Now I THOUGHT, that line told the 'system' to run 
> that script under Tcsh; but with my shell set to Bash, I get all kinds 
> of Bash errors on the first lines of the script and the script doesn't 
> run.  I've tried running "do script with command "/bin/tcsh;source 
> MozScript1d.txt;" " from an AppleScript to invoke Tsch first, and then 
> run the script; but all though Tsch gets invoked my scripts doesn't.
> 	Anyone know what I'm doing wrong or how I can correct this?

I believe you are running two commands.  The first is invoking
tcsh with no arguments and it immediately returns.  I believe it
returns because a non-interactive shell executes either the
command supplied by -c or the filename supplied.  Once all
commands are exhausted the shell quits.

[bpm at snafu] c:~>echo "do shell script \"/bin/tcsh;echo \$SHLVL\"" | osascript 
4
[bpm at snafu] c:~>echo "do shell script \"/bin/tcsh -c 'echo \$SHLVL'\"" | osascript
5
[bpm at snafu] c:~>echo "do shell script \"/bin/tcsh;'echo \$SHLVL'\"" | osascript
0:41: execution error: sh: line 1: echo $SHLVL: command not found (127)
[bpm at snafu] c:~>echo "do shell script \"/bin/tcsh 'echo \$SHLVL'\"" | osascript
0:41: execution error: tcsh: echo $SHLVL: No such file or directory. (1)
[bpm at snafu] c:~>echo "do shell script \"/bin/tcsh;echo '\$SHLVL'\"" | osascript
$SHLVL


http://developer.apple.com/technotes/tn2002/tn2065.html
    How do I run my command with a shell other than sh?

-- 
~`^`'~=-._.-=~'`^`'~=-._.-=~'^'~=-., \|/  (___)  \|/ _,.-=~'`^`
                                      @~./'O o`\.~@
      "Knowledge is Power"           /__( \___/ )__\  *PPPFFBT!*
         -- Francis Bacon               `\__`U_/'
 _.-=~'``'~=-._.-=~'``'~=-._.-=~'`^`'~= <____|'  ^^`'~=-.,__,.-=
~'^`'~=-._.-=~'`^`'~=-._.-=~'^'~=-.,__,.-==--^'~=-.,__,.-=~'`^`


More information about the X-Unix mailing list