I have one function in csh script, and in this function I use one variable, which is obtained from one file. But when using a script, an undefined error is thrown for it for the same variable. I am using Linux.
My code
function init_remote_commands_to_use { # Test if the environment variable SSH_FOR_RCOMMANDS is present in .temip_config file, # use secured on non secured rcommand depending on the result if [ "$SSH_FOR_RCOMMANDS" != "" ] then if [ "$SSH_FOR_RCOMMANDS" = "ON" ] then # Check if the environment variable SSH_PATH is specified in .temip_config file if [ "$SSH_PATH" != "" ] then SH_RCMD=$SSH_PATH else SH_RCMD=$SSH_CMD fi # Check if a ssh-agent is already running if [ "$SSH_AGENT_PID" = "" ] then #Run ssh-agent for secured RCommands eval `ssh-agent` ssh-add STARTEDBYME=YES fi else if [ "$SSH_FOR_RCOMMANDS" = "OFF" ] then SH_RCMD=$RSH_CMD else echo "Please set the SSH_FOR_RCOMMANDS value to ON or OFF in the .temip_config file" exit 1 fi fi else SH_RCMD=$RSH_CMD fi }
The following is the error:
function: Command not found. {: Command not found. SSH_FOR_RCOMMANDS: Undefined variable.
Please suggest what am I missing?
source share