shell - Bash List Files after a specific file -


i want run program on files in directory after specific file using bash script.

if have directory like:

filea fileb filec filed 

i want run ./prog <file> files after filec. how write bash script this?

i have

for file in ./tests/*;   ./prog $file   if [ $? -eq 0 ];     echo "success: $file"   else     echo "**failure: $file"     exit 1   fi done 

but, want start @ specific file in directory. doesn't need sorted since ls list files in specific order same each time.

i typically run script, , when fails, fix specific file, i'd want resume file, , not restart beginning.

if files sorted, can use '<' , '>' operators stringwise compare of 2 variables:

startfile=$1 file in ./tests/*;     if ! [ "$file" '<' "$startfile" ] ;         echo doing $file     else         echo skipping $file     fi done 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -