File Handling in Shell Scripts [Bash]

Posted By: Matpal - April 03, 2018

Create a file

Following shell script can create the file to a directory. In this example, it creates a text file in current directory.

echo "This is a text." > sample.txt

Reading a file

echo "$value"

Reading a file per line


while read line; do

echo $line
 done < sample.txt


Post a Comment

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