Script not working in Linux

It is working fine in HPUX, but not in LINUX.
Can you please advise how to tweak this script for LINUX?

Please help!

;rename the file to use uppercase letters
  set DCLcom = concat("mv $", filename, " $", uc_file_dir)
  call echo(DCLcom)
  set DCLlen = size(trim(DCLcom))
  set DCLstatus = 0
  call DCL(DCLcom,DCLlen,DCLstatus)

; FTP file to Specific Location
  call echo(concat("Preparing to FTP ",uc_filename,"... (",format(cnvtdatetime(curdate,curtime3),"MM/DD/YYYY HH:MM:SS;;D"),")"))

  declare cQuote     = c1 with protect,constant('"')
  declare sCommand   = vc with protect,noconstant("")
  declare iCmdStatus = i2 with protect,noconstant(0)

  set theRemoteHost = "xx.xx.xx.xx"
  set theRemoteUserName = "ANACOMP"
  set theRemotePassword = "xxxxxx"
  set theLocalDirectory = "$cer_print"
  set theRemotePath = "/FTP/Cereplex"
  set theLocalFileName = uc_file_dir
  set theRemoteFile = uc_filename


  set sCommand = concat("print ",
                        cQuote ,
                        "open ",
                        theRemoteHost,
                        "\n user ",
                        theRemoteUserName,
                        " ",
                        theRemotePassword,
                        "\n cd ",
                        theRemotePath,
                        "\nascii \n put $",
                        theLocalFileName,
                        " ",
                        theRemoteFile,
                        cQuote,
                        " | ftp -i -n")

  call echo(sCommand)

call dcl(sCommand,size(trim(sCommand)),iCmdStatus)

What language is this? It doesn't look like shell script or even csh.

To 'tweak it to work in linux' you would probably want to install an interpreter for whatever language this is, to start with.

I expect something like using shell script this will be close:

#rename the file to use uppercase letters
DCLcom="mv $filename $uc_file_dir"
echo $DCLcom
$DLCcom

#FTP file to Specific Location
echo "Preparing to FTP $uc_filename $(date)"

theRemoteHost="xx.xx.xx.xx"
theRemoteUserName="ANACOMP"
theRemotePassword="xxxxxx"
theLocalDirectory=$cer_print
theRemotePath="/FTP/Cereplex"
theLocalFileName=$uc_file_dir
theRemoteFile=$uc_filename


ftp -i -n <<EOF
  open $theRemoteHost
  user $theRemoteUserName
  $theRemotePassword,
  cd $theRemotePath,
  ascii
  put $theLocalFileName $theRemoteFile,
EOF

I tried this, but I got an error

{<}Unexpected symbol found.

, so it seems << is not working here.

---------- Post updated at 09:15 PM ---------- Previous update was at 09:12 PM ----------

If I take out

"print ", cQuote ,

, I am getting this error, so it seems

"print ", cQuote ,

is needed.

mv $cer_print/vhvhvxxlt09182013_1_2. $cer_print/vhvhvxxlt09182013_1_2.rtf
Preparing to FTP vhvhvxxlt09182013_1_2.rtf... (09/19/2013 14:30:08)
open 10.99.248.57\n user ####### xxxxxxxx\n cd /FTP/Cereplex\nascii \n put $cer_print/vhvhvxxlt09182013_1_2.rtf vhvhvxxlt09182013_1_
2.rtf" | ftp -i -n
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file

Please advise.

Q What is the local machine running the script ( OS ) and what is the remote ?

try again ... without the commas in any of the lines this time ...

ftp -i -n <<EOF
open $theRemoteHost
user $theRemoteUserName
$theRemotePassword
cd $theRemotePath
ascii
put $theLocalFileName $theRemoteFile
EOF

It is LINUX - running the script, and the destination server is Windows for FTP.
Please advise.

And you say from HPUX to Windows it worked ? ( And the windows machine has not changed... yes?...)

Yes, that is correct. It worked fine with HPUX, but not LINUX.

---------- Post updated at 01:23 PM ---------- Previous update was at 01:18 PM ----------

Interesting that I found is that:

If I execute this command (translated on the prompt),

 print "open 10.99.248.57\n user xxxxxxx xxxxxx\n cd /FTP/Cereplex\nascii \n put $cer_print/vhvhvxxlt09182013_1_2.rtf vhvhvxxlt09182013_1_2.rtf" | ftp -i -n

it puts the output file onto the destination folder regardless the warning message (/FTP/Cereplex: The system cannot find the path specified.)

mv $cer_print/vhvhvxxlt09182013_1_2. $cer_print/vhvhvxxlt09182013_1_2.rtf

Preparing to FTP vhvhvxxlt09182013_1_2.rtf... (09/19/2013 13:52:48)

print "open 10.99.248.57\n user xxxxxxxx xxxxxxx\n cd /FTP/Cereplex\nascii \n put $cer_print/vhvhvxxlt09182013_1_2.rtf vhvhvxxlt09182013_1_2.rtf" | ftp -i -n

/FTP/Cereplex: The system cannot find the path specified.

But if I execute the whole program, then no output is being sent.

The command (translated on the prompt) should be from this segment, so I am suspecting this would be the cause of the issue...

set sCommand = concat("print ",
cQuote ,
"open ",
theRemoteHost,
"\n user ",
theRemoteUserName,
" ",
theRemotePassword,
"\n cd ",
theRemotePath,
"\nascii \n put $",
theLocalFileName,
" ",
theRemoteFile,
cQuote,
" | ftp -i -n")

call echo(sCommand)

call dcl(sCommand,size(trim(sCommand)),iCmdStatus)

Please advise.

I'd still like to know what language tht was originally...

The script developer didn't put any comments, so I don't know...

If the script is an executable file, the interpreter must be listed at the top of the file.

If the script is not executable, then how are you executing it? From another script? From cron or some other scheduler? It should be easy to at least determine the name of the interpreter's executable.

Regards,
Alister

It is running under cron. I don't know what script it is....
After further troubleshooting, I resolved one thing

LNUX doesn't like print

print "open 10.99.248.57\n user xxxxxxxx xxxxxxx\n cd /FTP/Cereplex\nascii \n put $cer_print/vhvhvxxlt09182013_1_2.rtf vhvhvxxlt09182013_1_2.rtf" | ftp -i -n

so, it has to be printf

printf "open 10.99.248.57\n user xxxxxxxx xxxxxxx\n cd /FTP/Cereplex\nascii \n put $cer_print/vhvhvxxlt09182013_1_2.rtf vhvhvxxlt09182013_1_2.rtf" | ftp -i -n

But, still I have this error.
/FTP/Cereplex: The system cannot find the path specified.

This is the last error I need to resolve. Any ideas, please?