Skip to Content
0
Former Member
Nov 25, 2013 at 11:42 AM

Problem in script

18 Views

Hi,

I have a simple file to file scenario for testing purpose. Here I am using a shell script in the before processing of sender communication channel .

My aim is when I will rum the sender communication channel as the script is in before processing it will pick a .zip file from ftp of path /TEST/ and extract it and put the text file in another folder of the same ftp called /TEST2/ .

My script is running fine when I am testing it in PUTTY , but the problem is when I am putting it in the PI server and calling from communication channel its not working at all.

Here is my script :

#!/bin/sh

HOST=10.16.21.85

USER="migra_user"

PASSWD="apdcl"

dirName=/Test

dirName2=/Test2

ftp -n -i -v $HOST <<EOF

user $USER $PASSWD

cd $dirName

mget *.zip

quit

EOF

for z in *.zip;do unzip $z;done

rm *.zip

ftp -n -i -v $HOST <<EOD

user $USER $PASSWD

cd $dirName2

mput *.txt

quit

EOD

rm *.txt

And I am calling it from communication channel like that -

Please suggest me how to get rid of this.

Thanks,

Attachments

testUnzip.jpg (16.8 kB)