Mercurial > ec-dotfiles
view bin/basicopt @ 690:5b98946be635
[gitconfig] main as default branch name
author | nanaya <me@nanaya.pro> |
---|---|
date | Sun, 23 Oct 2022 01:44:48 +0900 |
parents | 7f5234a312f7 |
children |
line wrap: on
line source
#!/bin/sh get_filename() { printf '%s\n' "$*" | sed -e 's/^\(.*\)\.[^.]*$/\1/' } get_extension() { if [ -n "$(printf '%s\n' "$*" | sed -e 's/^[^.]*//')" ]; then printf '%s\n' "$*" | sed -e 's/^.*\(\.[^.]*$\)/\1/' else printf '%s\n' "" fi }