Bash script to ftp only files of type gz in current directory

view story

http://unix.stackexchange.com – I have a bash script that cd to the right directory then uses the mput command to ftp all the files in the directory to a remote server, as below: for from_dir in $DATE_LIST do cd ${FILE_LANDING_DIR}/deltas/${from_dir} ftp_files done ftp_files () { ftp -inv $HOST <<-EOF > $LOG_DIR/tempftplog user $USER $PASS cd ${ID_LANDING_DIR} mput * bye EOF } I tried altering the ftp_files function to ftp only the .gz files in that directory by changing the line from mput * to mput *.gz but that did not work. Can someone tell me how I can do this once in the (HowTos)