So I need to print a variable in bash script. I know we can run
echo "$variable" command to display a variable in bash prompt. But, I need to print it on screen and put it in a file same time. Is there a single command to do that?
var="abc" echo "$var"
I need last command such way to print on screen and put in a file called /tmp/log.txt so I tried this but it will only put in the file and not on screen:
var="abc" echo "$var" > /tmp/log.txt