home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #barryk 2005
-
- AFILE="`basename "$1"`"
-
- if [ "`echo -n "$AFILE" | grep '\.'`" = "" ];then
- /usr/local/bin/defaulttexteditor "$1"
- exit
- else
- AEXT="$AFILE"
- while [ ! "`echo -n "$AEXT" | grep '\.'`" = "" ];do
- AEXT="`echo -n "$AEXT" | cut -f 2-6 -d '.'`"
- done
- fi
-
- #this needs to be fleshed out a bit more...
- case $AEXT in
- txt|TXT)
- /usr/local/bin/defaulttexteditor "$1"
- ;;
- doc|DOC|rtf|RTF)
- /usr/local/bin/defaultwordprocessor "$1"
- ;;
- xls|XLS)
- /usr/local/bin/defaultspreadsheet "$1"
- ;;
- htm|html|HTM|HTML)
- /usr/local/bin/defaulttexteditor "$1"
- ;;
- png|PNG|gif|GIF|jpg|JPG|jpeg|JPEG|xpm|XPM)
- /usr/local/bin/defaultpaint "$1"
- ;;
- pdf|PDF|ps|PS|eps|EPS)
- gsview "$1"
- ;;
- *)
- /usr/local/bin/defaulttexteditor "$1"
- ;;
- esac
-
- ###END###
-