At the bottom of my bash script, after all of my needed bash aliases and functions have been defined, I've got just a single line to be executed when the script is run:
echo "$# args: $@ passed to bash script"
I then define an alias in my ~/.tcshrc to call this script:
alias savall2all 'bash $BACKUP/savall2all.bash \!*'
In the tcsh calling script, the !* is supposed to pass in all of the command line arguments. I then use this alias on the tcsh command line after checking my parameters:
echo $RST
> /Users/My/Documents/DESK/DESK_N2R/RST
echo $HST
> /Users/My/Documents/DESK/DESK_E2M/HST
savall2all $RST $HST
> 1 args: SD02FL=/Volumes/SuperDuper-02-Files passed to bash script
Note first that I pass 2 args to savall2all but it gets only one. Inexplicably, moreover, the parameter the bash script actually gets is something out of the blue. It has nothing to do with the bash script or what I'm passing to it. There is such an environment variable set elsewhere in the ~/.tcshrc calling script but I cannot explain how it's getting pulled into my use of this alias.
I've researched and tried a wide range of variations on both tcsh and bash structure and syntax but get the same result every time.
echocommand at the beginning, rather than end, of the bash script; 2) pass those arguments to the alias literally rather than via variables. Also, what is that other variable you mentioned, and how is it used (/does it occur at all in the bash script), and does the bash script use thesetcommand at any point?\!*is not necessary.setis not used inbashto define shell variables, but to define shell options and positional parameters.SD01='...', etc, is all you need to define a shell variable.set a=1actually sets the first positional parameter to the literal stringa=1:set a=1; echo "$1"will outputa=1, not perform an assignment toa.