Showing posts with label append file. Show all posts
Showing posts with label append file. Show all posts
File Handling using Shell Scripts
Posted by Raj
File Handling using Shell Scripts
In this article,I will explain File Handling using Shell Scripts.
Example: Add line at beginning of file.
Filename: test.sh
In this article,I will explain File Handling using Shell Scripts.
Example: Add line at beginning of file.
Filename: test.sh
#!/bin/bash read -p "File Name: " file if [ ! -e "$file" ] then echo "File $file not found." exit 50 fi read -p "Name: " name cat - $file <<<$name > $file.new exit 0