2008-06-23

For BashWiki (if not there yet)

Bash Wiki with tips and trick you can find at Wooledge.org


noneo:~$ man read
No manual entry for read

noneo:~$ help read

:-)

Other tricks:

for i in "$(< "$file")"; do echo $i; done

n=0; while :; do echo $n; let n=$n+1; done

sudo tail -f /var/log/auth.log | while read LINE
do
if [[ $LINE =~ "session opened" ]]
then
NEWUSER=`echo $LINE | awk '{ print $11; }'`
zenity --error --text="$NEWUSER logged in"
fi
done

: ${2?"Two parameters required. Please fix it."}


To Be Continued...

No comments: