Mahmoud Shater Mahmoud Shater - 2 months ago 52
Bash Question

Insert value of variable into a file

I would like to insert the value of a variable into a file.

I have tried redirection, but it isn't working:

$HOME > file1

The op displayed on the screen, not in

Answer Source

You need to use echo to get the output.

echo $HOME > file1
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download