FTP is a commonly used <indexentry content="here document:<protocol to transfer data on websites. FTP stands for File Transfer Protocol. The following steps show the <indexentry content="here document:<usage of FTP and data transfer:
- Write the here_07.sh script:
#!/bin/bash # Checking number of arguments passed along with command if [ $# -lt 2 ] then echo "Error, usage is:" echo "ftpget hostname filename [directory]." exit -1 fi hostname=$1 filename=$2 directory="." # Default value if [ $# -ge 3 ] then directory=$3 fi ftp << End_Of_Session open $hostname cd $directory get $filename quit End_Of_Session echo "FTP session ended."
- Save the file, give the permission to execute, and ...