Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

empty waiting for string but continuing premature

1 view
Skip to first unread message

Ecaroh

unread,
Nov 23, 2009, 12:11:40 PM11/23/09
to
Hello!

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

Ben Finney

unread,
Nov 23, 2009, 5:51:03 PM11/23/09
to
Ecaroh <gerhard....@ecaroh.de> writes:

> 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

Alan Curry

unread,
Nov 23, 2009, 7:36:35 PM11/23/09
to
In article <87tywk9...@benfinney.id.au>,

Ben Finney <bignose+h...@benfinney.id.au> wrote:
>Ecaroh <gerhard....@ecaroh.de> writes:
>
>> 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.

>


>What is this ‘empty’ command, and where does it come from?

probably http://empty.sf.net/

--
Alan Curry

0 new messages