I am trying to learn QSHELL but I seem to be encountering an error on my first line.
Below is the code. The script is suppose to check if it received 7 parameters. I am encountering a "token not expected" in the if statement. If the semi-colon is there there error will be "token ; not expected.". If it is not there it will say "then not expected". Whatam I doing wrong?
I am executing the script in QSH.
If I want to use RPG to create a script dynamically how would I do it?
Below is the code. The script is suppose to check if it received 7 parameters. I am encountering a "token not expected" in the if statement. If the semi-colon is there there error will be "token ; not expected.". If it is not there it will say "then not expected". Whatam I doing wrong?
Code:
#!/QOpenSys/usr/bin/sh LOG=/home/<user>/log.err.$$.log if [ $# != 7 ]; then echo "syntax: $0 <user> <hostname> <port> <lib> <file> <source dir> <archive>" exit 1 fi export USER=$1 export HOSTNAME=$2 export PORT=$3 export LIB=$4 export FILE=$5 export SDIR=$6 export ADIR=$7
If I want to use RPG to create a script dynamically how would I do it?
Comment