0

I have a bash script that I use to call a c++ program, each time indicating a different file name (see below). At present the file number is not increasing; do you have any suggestion on how to change that? Thanks!

for i in {0..48}; do
    ./program file$05i.jpeg
done
albus_c
  • 6,292
  • 14
  • 36
  • 77

1 Answers1

4

Seems like you mean this,

for i in {0..48}; do
    ./program file05$i.jpeg
done

This will execute file050.jpeg, file051.jpeg upto 48.

Update:

for i in $(seq -f "%05g" 0 48); do
    ./program file$i.jpeg
done

Reference

Community
  • 1
  • 1
Avinash Raj
  • 172,303
  • 28
  • 230
  • 274