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
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
append file,
bash append,
bash output to file,
bash shell file exists,
File Handling,
if file bash,
shell script append file,
shell script declare,
unix script file exists,
unix shell file exists
.You can leave a response, or trackback from your own site.