Thu May 08 14:00:20 HKT 2008 From /weblog/unix/script
date
A working date calculation script
http://www.unix.com[..]s/4870-days-elapsed-between-2-dates.html
(google search) (amazon search)
|
|
download here
Thu May 08 14:00:20 HKT 2008 From /weblog/unix/script dateA working date calculation script http://www.unix.com[..]s/4870-days-elapsed-between-2-dates.html (google search) (amazon search) Fri Apr 18 10:28:56 HKT 2008 From /weblog/unix/script bashSample bash completion SSH_COMPLETE=( $(cut -f1 -d' ' ~/.ssh/known_hosts |\ tr ',' '\n' |\ sort -u |\ grep -e '[:alpha:]') ) complete -o default -W "${SSH_COMPLETE[*]}" ssh http://kasparov.skife.org/blog/stuff/starting-a-meme.html Check history statistic - brianm@binky:~$ history | awk {'print $2'} | sort | uniq -c | sort -k1 -rn | head 164 svn 52 cd 42 ssh 32 sudo 22 git 16 ls 16 for 14 echo 13 man 10 curl brianm@binky:~$ http://bluebones.net/2008/04/history-meme/ (google search) (amazon search) Thu Nov 15 01:31:37 HKT 2007 From /weblog/unix/script Convert PDF to set of image as slide show - http://ejohn.org/blog/easy-pdf-sharing/ (google search) (amazon search) Thu Jul 05 01:38:01 HKT 2007 From /weblog/unix/script developmentA bash debugger - http://bashdb.sourceforge.net/ (google search) (amazon search) Tue May 08 16:57:30 HKT 2007 From /weblog/unix/script useful example of shell script======================================create real player song list #!/bin/sh win_path=C:/tools linux_path=/mnt/disk/winapp for file in `find $1 -type f`; do if(`/bin/cat $file | grep $win_path`); then echo $file;fi; done; /usr/bin/find $MUSIC_SRC -type f -exec /bin/echo file://{} \; > $TMPDIR/tmp.rm while read i ; do /bin/echo "$RANDOM $i" ; done < $TMPDIR/tmp.rm | /bin/sort -n | /bin/sed 's/^[0-9]* //' > $TMPDIR/tmp1.rm /bin/cat $TMPDIR/tmp1.rm |/bin/sed -e 's/file:\/\///' >$HOME/mplayer.list /bin/cat $TMPDIR/tmp1.rm |/bin/grep -vi wma >$HOME/real.rm /bin/cat $TMPDIR/tmp1.rm |/bin/sed -e 's/file:\/\/\/var\/www\/html/http:\/\/www.carfield.com.hk/'>/var/www/html/.secure/media/music/live.rm ======================================remove log for file in `find -type f|grep website.|grep -v lck`;do rm -f $file;done ======================================for loop for((a = 1; a <10; a++)); do wget -b "http://www.thai.net/ferrari545/bbs_series/ku_bbs_000$a.jpg";done ======================================resize photo for i in *.jpg; do convert -geometry 1024x768 $i newdir/$i ; done ======================================basic calculation i=1;find|grep -v zng|grep -v avi|while read file;do mv "$file" $i.jpg;i=$((i+1));done ======================================# Make 3 a copy of 1 (stdout) exec 3>&1 result="$(command to generate stream \ | tee /dev/fd/3 \ | command to process stream)" # Now work with $result # The original stream also went to the console http://binkley.blogspot.com[..]5/getting-more-from-streams-in-bash.html (google search) (amazon search) Sat Mar 03 12:58:38 HKT 2007 From /weblog/unix/script find exampleAn question about how to remove unused package from MacOSX turn out to be an example of "find" command: http://forums.osxfaq.com/viewtopic.php?p=57887#57887 http://www.osxfaq.com/tips/unix-tricks/week98/tuesday.ws File Search tips in Linux - http://discuss.joelonsoftware.com[..]iscussTopicParent=18272&ixDiscussGroup=3 (google search) (amazon search) Fri Jun 16 21:37:41 HKT 2006 From /weblog/unix/script check exit statusNeed to check #? and PIPESTATUS http://www.mattryall.net/article.cgi?id=247 (google search) (amazon search) Sun May 28 18:31:46 HKT 2006 From /weblog/unix/script Batch renameScript of batch rename at unix system http://mattfleming.com/node/110 http://stuart.woodward.jp/?p=279 (google search) (amazon search) Tue Nov 08 14:33:09 HKT 2005 From /weblog/unix/script Unix KornShell Quick Referencehttp://www.maththinking.com/boat/kornShell.html (google search) (amazon search) Tue Oct 04 11:58:05 HKT 2005 From /weblog/unix/script safer rmA number of tips to make rm command safer http://www.macosxhints.com[..]le.php?story=20050928082624470&lsrc=osxh (google search) (amazon search) Wed Jul 06 11:40:45 HKT 2005 From /weblog/unix/script find deleteuse 'find' to delete branch of file: http://keithdevens.com/weblog/archive/2005/Jul/05/find.rm (google search) (amazon search) |