Mercurial > ec-dotfiles
annotate bin/basicopt @ 237:0d008b554aac
Merge with moefetch! Probably shouldn't be done but it's just much more convenient this way.
| author | Edho Arief <edho@myconan.net> | 
|---|---|
| date | Sun, 02 Oct 2011 04:33:47 +0700 | 
| parents | 5bafb912837e | 
| children | 7f5234a312f7 | 
| rev | line source | 
|---|---|
| 124 
5bafb912837e
Massive addition of old scripts collection.
 Edho Prima Arief <edho@myconan.net> parents: diff
changeset | 1 #!/bin/sh | 
| 
5bafb912837e
Massive addition of old scripts collection.
 Edho Prima Arief <edho@myconan.net> parents: diff
changeset | 2 get_filename() { | 
| 
5bafb912837e
Massive addition of old scripts collection.
 Edho Prima Arief <edho@myconan.net> parents: diff
changeset | 3 printf "%s\n" "$*" | sed -e 's/^\(.*\)\.[^.]*$/\1/' | 
| 
5bafb912837e
Massive addition of old scripts collection.
 Edho Prima Arief <edho@myconan.net> parents: diff
changeset | 4 } | 
| 
5bafb912837e
Massive addition of old scripts collection.
 Edho Prima Arief <edho@myconan.net> parents: diff
changeset | 5 get_extension() { | 
| 
5bafb912837e
Massive addition of old scripts collection.
 Edho Prima Arief <edho@myconan.net> parents: diff
changeset | 6 if [ -n "$(printf "%s\n" "$*" | sed -e 's/^[^.]*//')" ]; then | 
| 
5bafb912837e
Massive addition of old scripts collection.
 Edho Prima Arief <edho@myconan.net> parents: diff
changeset | 7 printf "%s\n" "$*" | sed -e 's/^.*\(\.[^.]*$\)/\1/' | 
| 
5bafb912837e
Massive addition of old scripts collection.
 Edho Prima Arief <edho@myconan.net> parents: diff
changeset | 8 else | 
| 
5bafb912837e
Massive addition of old scripts collection.
 Edho Prima Arief <edho@myconan.net> parents: diff
changeset | 9 printf "%s\n" "" | 
| 
5bafb912837e
Massive addition of old scripts collection.
 Edho Prima Arief <edho@myconan.net> parents: diff
changeset | 10 fi | 
| 
5bafb912837e
Massive addition of old scripts collection.
 Edho Prima Arief <edho@myconan.net> parents: diff
changeset | 11 } | 
