#!/bin/bash # to test it continuosly I keep 1copy.txt untouched # there are 4 lines in it, the first line is # ac wavSound\test.wav adpSound\test01.adp -norm cat 1copy.txt > 1.txt i=`wc -l 1.txt | awk '{print $1}'` # get line count while [[ $i -gt 0 ]] do (( i-- )) head -n1 1.txt > bat.bat # get first line into bat file sed 1d 1.txt > 2.txt # remove first line and save it new file mv 2.txt 1.txt # move it back to original file #put bat file onto Windows machine sftp adp@10.10.110.222 <