Bash
From wiki.vincentkong.com
Contents |
Setting environment variable
$ export PATH=$PATH:/home/username/bin $ echo $PATH
If statement
Test if file exist
if [ -a FILE ]
then
echo "File exist."
fi
Reference: http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html
Read a file line by line
#!/bin/bash
while read line
do
echo -e "$line\n"
done < filename.txt