Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
3
-
9223372036854775807
Description
All those tests launch a command in the background and want to check whether or not the command completes, they do so like this:
test_3*()
{
...
md5sum $f > /dev/null &
local pid=$!
...
local rc=$(wait $pid)
[[ $rc -eq 0 ]] || error "..."
}
Putting aside the fact that launching wait in a subshell like this will not work (pid 12345 is not a child of this shell), local rc=$(command) is not the way to check a return code in bash.
This code should be replaced with:
test_3*()
{
...
md5sum $f > /dev/null &
local pid=$!
...
wait $pid || error "..."
}