Created
May 31, 2017 10:57
-
-
Save ssledz/dff826c961b4c1796d7c6a8f25f57728 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
assert_exit_status() { | |
lambda() { | |
local val_fd=$(echo $@ | tr -d ' ' | cut -d':' -f2) | |
local arg=$1 | |
shift | |
shift | |
local cmd=$(echo $@ | xargs -E ':') | |
local val=$(cat $val_fd) | |
eval $arg=$val | |
eval $cmd | |
} | |
local lambda=$1 | |
shift | |
eval $@ | |
local ret=$? | |
$lambda : <(echo $ret) | |
} |
Author
ssledz
commented
May 31, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment