help with bash script
Tim Tebbit
ttebbit at gmail.com
Tue Jul 21 21:59:12 UTC 2009
R Kimber wrote:
> I'm trying to do something very simple but failing, and would appreciate
> some pointers.
>
> I'm trying to create a script that executes a command on a series of files
> one-at-a-time, pausing between each execution. The input files are all in a
> single file, one on each line. I have
> .......................
> #!/bin/bash
> cd <to working directory>
> cat <file with list of input files> | while read FILECHECKED do
>
> <command> "$FILECHECKED"
> echo
> RESPONSE="Z"
> echo -n Press a key to continue....
> while [ "$RESPONSE" = "Z" ]
> do
> read RESPONSE
> done
> echo
> done
> ......................
>
> The command executes, but there is no pause between the processing of each
> input file. I've tried various variations using the read command, to no
> avail. Curiously, if I add
> echo "$FILECHECKED" and "$RESPONSE"
> just before the final 'done', it prints out the name of the file it has
> just processed and the file it is about to process - not 'Z'.
>
> I'm obviously doing something stupid.
>
> - Richard.
sleep?
RESPONSE="Z"
sleep 1
echo ......
while
More information about the ubuntu-users
mailing list