Mercurial > ec-dotfiles
comparison bin/basicopt @ 129:f18a27a0e8fc
Merge branch.
| author | Edho Arief <edho@myconan.net> |
|---|---|
| date | Sat, 29 Oct 2011 11:40:35 +0700 |
| parents | 5bafb912837e |
| children | 7f5234a312f7 |
comparison
equal
deleted
inserted
replaced
| 121:0c3b473b9af7 | 129:f18a27a0e8fc |
|---|---|
| 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 } |
