I am trying to create a script that syncs my computer with google drive using the grive tool. I would like to store the output of the grive
command to a bash variable, but I can't seem to get it to work.
Some googling has taught me that command outputs can be saved to variables using the following syntax:
VARABLENAME=$(command)
and the output can be later printed by
echo ${VARIABLENAME}
However, the grive command seems to be an exception to this because when I use this syntax, it still prints out the output in the terminal and the contents of the variable is empty.
How I can store the output of grive
in a variable properly?
VARABLENAME="$(command 2>&1)"
and then check withecho "${VARIABLENAME}"
..