When i run the script then i get the following error
However when i run each of the commands on the commandline they get executed and provide the desired output. i cant figure out why the script is not running.
I don't get that error when I try your script. Make sure that you are running it correctly. That error will happen if the old bourne shell was to try to run this script.
I'm sorry if it's obvious but you might have a bad invisible character in there, if the script has ever been near a Windows machine. Try running it through dos2unix to clean it up
I tried your suggestion S. but it didn't make any difference.
Perdarbo i am running my script in ksh. Like i said, if i run it line by line on the command line, it works perfectly well. However, even when i log in to ksh and run it from there, it still throws up the same error.
Its got me stumped.