comparison bin/basicopt @ 138:f963d52c031a

Merge.
author Edho Arief <edho@myconan.net>
date Wed, 02 Nov 2011 22:12:16 +0700
parents 5bafb912837e
children 7f5234a312f7
comparison
equal deleted inserted replaced
137:983beb13c736 138:f963d52c031a
1 #!/bin/sh
2 get_filename() {
3 printf "%s\n" "$*" | sed -e 's/^\(.*\)\.[^.]*$/\1/'
4 }
5 get_extension() {
6 if [ -n "$(printf "%s\n" "$*" | sed -e 's/^[^.]*//')" ]; then
7 printf "%s\n" "$*" | sed -e 's/^.*\(\.[^.]*$\)/\1/'
8 else
9 printf "%s\n" ""
10 fi
11 }