How can i achive that `empty -r' waits for STRING before it continues
the next shell command? If i call empty from command prompt or in a
shell script empty continues after 15 seconds although i gave empty a
`-t 300' to wait for 5 minutes.
Problem: I have to wait for `string' _before_ proceeding with the shell
script `myempty.sh'. This is an example of what i want to achieve:
### start of script myempty.sh ###
#!/bin/bash
empty -f -i in.fifo -o out.fifo myelf.bin
empty -r -t 300 -b 254 -i out.fifo | grep "Continue"
# now the shell script _should not continue_ until "Continue"
# is found - or the timeout of 5 minutes happens. In case of a
# timeout immediately exiting _without_ continuing the script.
#
# now do something which depends on the expected string:
somemorecommands # do further commands ...
# then after the commands are completed we can continue normal:
emtpy -s -o in.fifo "Yes\n"
# to complete dialog with myelf
### end of script ###
Is there anything i am doing wrong? Or is it not possible to pause the
shell script until the expected string is found.
Ecaroh
> How can i achive that `empty -r' waits for STRING before it continues
> the next shell command? If i call empty from command prompt or in a
> shell script empty continues after 15 seconds although i gave empty a
> `-t 300' to wait for 5 minutes.
$ bash --version
GNU bash, version 4.0.28(1)-release (powerpc-unknown-linux-gnu)
[…]
$ type empty
bash: type: empty: not found
Also not found in <URL:http://www.opengroup.org/onlinepubs/9699919799/>.
What is this ‘empty’ command, and where does it come from?
--
\ “Holy priceless collection of Etruscan snoods, Batman!” —Robin |
`\ |
_o__) |
Ben Finney
>
>What is this ‘empty’ command, and where does it come from?
probably http://empty.sf.net/
--
Alan Curry