I am getting a few gzip files into a folder by doing ftp to another server. Once I get them I move them to another location .But before that I need to make sure each gzip is not more than 5000 lines and split it up . The files I get are anywhere from 500 lines to 10000 lines in them and is in gzip format.
#!/bin/sh
echo "get gzip files"
sftp user1@server1<<EOF
get *.gzip
quit
EOF
for each in *.gzip;
do
mv $each /home/newlocation
done << EOF