Bash

= Basics = Source: ss64.com

echo -n "Count: " >> files.txt find. | wc -l >> files.txt
 * Echo continue on same line:

$1, $2, $3   are the positional parameters. "$@"         is an array-like construct of all positional parameters, {$1, $2, $3 ...}. "$*"         is the IFS expansion of all positional parameters, $1 $2 $3 .... $#            is the number of positional parameters. $-           current options set for the shell. $$           pid of the current shell (not subshell). $_           most recent parameter (or the abs path of the command to start the current shell immediately after startup). $IFS         is the (input) field separator. $?           is the most recent foreground pipeline exit status. $!           is the PID of the most recent background command. $0           is the name of the shell or shell script.
 * Variable

dir="/data/.folder/" path="/home/system/Desktop/pending_files.txt" tree $dir | wc -l >> $path
 * Using Variables in Bash:

=Scripts=


 * Mplayer Play Live Gurbani from 8 to 10AM

trickle -d 20 -u 15 mplayer mms://sgpc.net/live & sleep 2h kill $!
 * 1) !/bin/bash

Cron Entry: 0 8 * * * ./mplayer.sh


 * Download Newspaper front page

http://newspaper.ajitjalandhar.com/newspages/20130226/20130226_1_1.jpg

 cd ~/Desktop D=$(date +"%Y%m%d") FILE="$D"_1_1.jpg if [ -f $FILE ]; then exit else wget "http://newspaper.ajitjalandhar.com/newspages/"$D"/"$D"_1_1.jpg" && notify-send -i /data/Softwares/Wallpapers/icons/ajit.png -t 50 "Ajit Jalandhar" "is saved at your desktop" fi
 * 1) !/bin/bash

Cron Entry: 0 7-11 * * * ./ajit.sh


 * References
 * Reference Guide: gnu.org
 * Check Scripts for errors: shellcheck.net