redirecting variable content to a file!

Hello!

I'm having problems trying to extract the contents of a variable and placing it into a text file. Grateful for any help.

Been trying something along the lines of:

$variable > file.txt

or

`cat < $variable` > file.txt

As you can see I'm a newbie to this :smiley:

echo "$variable" > file.txt

A link to some useful tutorials:

http://www.unix.com/answers-frequently-asked-questions/13774-unix-tutorials-programming-tutorials-shell-scripting-tutorials.html

Regards

Great thanks :slight_smile: