„gaboshlib/g_runcmd.bashfunc“ hinzufügen
This commit is contained in:
parent
9c7bb2c86d
commit
beb0535f03
13
gaboshlib/g_runcmd.bashfunc
Normal file
13
gaboshlib/g_runcmd.bashfunc
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
function g_runcmd {
|
||||
$@ >$g_tmp/g_runcmd-output 2>&1
|
||||
g_runcmd_exitcode=$?
|
||||
if [ $g_runcmd_exitcode -eq 0 ]
|
||||
then
|
||||
g_echo_ok "$@: $(cat $g_tmp/g_runcmd-output)"
|
||||
else
|
||||
g_echo_error "$@: $(cat $g_tmp/g_runcmd-output)"
|
||||
fi
|
||||
return $g_runcmd_exitcode
|
||||
}
|
Loading…
Reference in New Issue
Block a user