Friday, 22 April 2016

How to write to a file ?


To write something to a file is fairly simple : 
echo "something" > myfile
will put the word something in a file called myfile.

To write value of a variable to a file : 
echo "$read_line" > myfile

If file is not present and to create a new file, you can use : 
touch myfile

No comments:

Post a Comment

Note: only a member of this blog may post a comment.