comparison bin/basicopt @ 124:5bafb912837e

Massive addition of old scripts collection.
author Edho Prima Arief <edho@myconan.net>
date Wed, 26 Oct 2011 15:22:00 +0700
parents
children 7f5234a312f7
comparison
equal deleted inserted replaced
123:173833e4ba35 124:5bafb912837e
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 }