Friday 26 October 2012

Put file content into a variable

Linux

filetext=`cat printme`
echo "$filetext"

NOTE: note the ` char.
This will read the file printme and will assign its text to the variable filetext

No comments:

Post a Comment