I want to hide the output of a command in the shell, but I still want to use the output in a variable: I am using this:
recmake=$(type -t cmake)
But I don't want an output in the shell. Only in the variable.
How can I do this.
Nils
I want to hide the output of a command in the shell, but I still want to use the output in a variable: I am using this:
recmake=$(type -t cmake)
But I don't want an output in the shell. Only in the variable.
How can I do this.
Nils
You could add your code recmake=$(type -t cmake)
to your .bashrc
file and then load the variables like this: source ~/.bashrc
.
Have you tried the following, put everything inside of a bash script,nameofyourscript
, and run it?
#!/bin/sh
recmake=$(type -t cmake)
echo $recmake
Then you do chmod +x nameofyourscript
and ./nameofyourscript