Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All workload start scripts get benchmark command's return code wrong #453

Open
rayx opened this issue Jul 15, 2024 · 0 comments
Open

All workload start scripts get benchmark command's return code wrong #453

rayx opened this issue Jul 15, 2024 · 0 comments

Comments

@rayx
Copy link
Contributor

rayx commented Jul 15, 2024

All workload start scripts use the following pattern to get benchmark command's return code:

        syslog_netcat "Command output will be shown"
        $command_line 2>&1 | while read line ; do
            syslog_netcat "$line"
            echo $line >> $GEN_OUTPUT_FILE
        done
        ERROR=$?

$? is the return code of the last command in the pipe, not that of the benchmark command.

Fix: a few solutions are list in the discussion on how to get the first command's return code. The simplest one is using ${PIPESTATUS[0]} (it's a bash specific variable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant