„gaboshlib/g_runcmd.bashfunc“ hinzufügen

This commit is contained in:
olli 2022-12-01 10:23:49 +01:00
parent 9c7bb2c86d
commit beb0535f03

View 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
}