view bin/basicopt @ 729:a01648ad62b7 default tip

[vimrc] Use correct srcery option? Dunno where the previous one went to but it stopped taking effect.
author nanaya <me@nanaya.net>
date Mon, 06 Jan 2025 17:12:49 +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
}