I want to create shell script to invoke tftp transfer of particular file to my local machine
this is the operation i want to do
tftp 172.2.22.2
get file1_in_remote location file2_in_local_machine
quit
tftp>
get: command not found
quit: command not found
tftp 173.32.52.12 -c get MyFile1.txt MyFile2.txt
tftp 173.32.52.12 -c get MyFile1.txt MyFile2.txt MyFile3.txt etc. etc.
I found the solution.
file1_in_remote location = "/tftpboot/file1.txt"
file2_in_local_machine = "/home/file2.txt"
tftp 172.2.22.2 << !
#file names can be stored in varible
get ${file1_in_remote location} ${file2_in_local_machine}
quit
!
This worked for me
And There is one more solution
tftp 172.2.22.2 << 'EOF'
#explictely specify the file names. varibales wont accept here.
get /tftpboot/file1.txt /home/file2.txt
quit
EOF
but in second solution you have to give the file location explicit. And in the 1st solution file name can be stored in variable and we can use that variable in the "get" command.