Skip to content

mklink_safe

zeta709 edited this page Feb 1, 2022 · 1 revision
mklink_safe() {
	# target=$1; link_name=$2;
	if [ -e "$2" ] && [ ! -L "$2" ]; then
		printf "'%s' is not a symbolic link; it will not be replaced.\n" "$2"
		return 1
	fi
	ln -sf "$1" "$2"
}

Clone this wiki locally