################################################### ## ## Code Snippets - Reuseable pieces of Scripting code ## ################################################### # display date as YYYmmdd and remove trailing new line - good for filenaming date +%Y%m%d | tr -d '\n|\r' or datestring=$(date +"%Y%m%d") # shell script way of creating a tmp file with pid # and being sure the tmp file is erased even if the script does not # properly complete TMP=/tmp/tmp_out.$$ trap "/bin/rm -f $TMP; exit" 0 Perl: # for hidding a password typed as command line argument use Term::ReadKey; print "Hidden password: "; ReadMode('noecho'); # don't echo chomp (my $pwd = ); ReadMode(0); # back to normal