readcmd() {
varname="$1";
cmdline="${@:2}";
read $varname < <($cmdline)
};
Last active
October 27, 2019 03:19
-
-
Save rohan-molloy/c387eb0111d883527f8132a923232ea1 to your computer and use it in GitHub Desktop.
Bash function to read the output of a command into a variable
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment