My shell: bin/kshMy system:Linux 2.6.18-406.el5 #1 SMP Fri May 1 10:37:57 EDT 2015 x86_64 x86_64 x86_64 GNU/LinuxMy script:ftp -divn XXX.XXX.XX0 << EOF!user user passcd /home/dir1/dir2/dir3/lcd /home/dir34/dir45get filenamebyeEOF!My issue:I want to automate this process. I do not want to write all lines of code, what I would like is to write only the final directory input , the directory is output and the file name .For example:I want to send FILE1.txt from cd /home/dir1/dir2/dir3/dirdata to /home/dir34/dir45/dirfinalI want to execute the script and only write in console:dirdatadirfinalFILE1.txt
Automating ftp processes
linux;ksh
magic_script dirdata dirfinal file1.txt$0 is the script_name (magic_script)$1 first argument dirdata$2 second argument dirfinal$3 third argument file1.txtftp -divn XXX.XXX.XX0 << EOF!user user passcd /home/dir1/dir2/dir3/$1lcd/home/dir11/dir22/dir33/$2get $3byeEOF!