I wrote a shell script that does data manipulation on a server running bash shell.
My script has a function which retrieves data inside ZIP files
function getCTLfile() {
for i in ${Array[@]}; do
if [[ `echo ${i}|awk -F . '{print $NF}'` == "ctl" ]]; then
echo "${i}"
fi
done
}
It works great but this machine hardware is faulty so our sysadmin requested that I port my code to another server running Korn shell.
When I run my script, it fails on my function!! Even if I type it from the command line.
$ function getCTLfile() {
-ksh: syntax error: `(' unexpected
Do I need to change my syntax anywhere? I did some research and it seems that everything should work.