Enter the PIPEARRAY from bash, which allows you access to the each commands return value in the entire chain. The problem with Ruby is that this is not available after the system function ends. Again, using some smart Bash you can exit your command chain with the contents of the PIPEARRAY like this:
# a system call that exits with the value of the first command 'make'. system("make | tee output.log; exit ${PIPESTATUS[0]}") # examine the returned value of the command 'make' puts $?.exitstatus
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.