comparison bin/basicopt @ 609:7f5234a312f7

Cleanup style
author nanaya <me@nanaya.pro>
date Fri, 07 Jul 2017 19:35:52 +0900
parents 5bafb912837e
children
comparison
equal deleted inserted replaced
608:f894f33a762c 609:7f5234a312f7
1 #!/bin/sh 1 #!/bin/sh
2 get_filename() { 2 get_filename() {
3 printf "%s\n" "$*" | sed -e 's/^\(.*\)\.[^.]*$/\1/' 3 printf '%s\n' "$*" | sed -e 's/^\(.*\)\.[^.]*$/\1/'
4 } 4 }
5 get_extension() { 5 get_extension() {
6 if [ -n "$(printf "%s\n" "$*" | sed -e 's/^[^.]*//')" ]; then 6 if [ -n "$(printf '%s\n' "$*" | sed -e 's/^[^.]*//')" ]; then
7 printf "%s\n" "$*" | sed -e 's/^.*\(\.[^.]*$\)/\1/' 7 printf '%s\n' "$*" | sed -e 's/^.*\(\.[^.]*$\)/\1/'
8 else 8 else
9 printf "%s\n" "" 9 printf '%s\n' ""
10 fi 10 fi
11 } 11 }