[pve-devel] perl pipe problems

Dietmar Maurer dietmar at proxmox.com
Mon Oct 29 07:54:24 CET 2012


I just noticed that a normal unix shell pipe return the exits status of the last command.

For example

# false|true

returns true

in perl:

# perl -e 'system("false | true");print $?>>8,"\n"'
0

Instead, we want such command to fails. For example, consider a backup
which piped the output to another command (gzip).

see also https://bugzilla.proxmox.com/show_bug.cgi?id=264

I tried to use option 'pipefail' but get:

# perl -e 'system("set -o pipefail;false | true");print $?>>8,"\n"'
set: 1: Illegal option -o pipefail

Any ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20121029/8f71fc50/attachment.htm>


More information about the pve-devel mailing list