[arch-projects] [initscripts] [PATCH] Setting Locale: fix status reporting FAIL erroneously

Tom Gundersen teg at jklm.no
Sun Jun 26 07:51:56 EDT 2011


On Sun, Jun 26, 2011 at 1:03 PM, Kurt J. Bosch
<kjb-temp-2009 at alpenjodel.de> wrote:
> The following test case (run in a terminal)
>
> #!/bin/bash
>
> # custom override example
> stat_busy() {
>        if (( PUSH_MSG )); then
>                # This triggers the error in "$@" below
>                # actual code was:
>                # echo set message "$1" > "$spl_fifo" &
>                : &
>        fi
>        echo "$1" BUSY
> }
>
> status() {
>        stat_busy "$1"
>        shift
>        "$@"
>        local retval=$?
>        (( retval == 0 )) && echo DONE || echo FAIL "($retval)"
> }
>
> PUSH_MSG=0 status "test #0" cat <(echo foo)
> PUSH_MSG=1 status "test #1" cat <(echo foo)

[...]

> CCing Tom Gundersen.

Thanks.

I have not figured it out, but here is a more minimal test:


#!/bin/bash


test_one() {
       : &
       "$@"
}

test_two() {
       :
       "$@"
}

# working
test_one eval 'cat <(echo foo)'
test_two cat <(echo foo)

#not working
test_one cat <(echo foo)


More information about the arch-projects mailing list