rosenrot/rose-mklink
NunoSempere 5e403cad14 fix: small sh/bash incompatibility in rose-mklink
'echo -e' throws a warning in sh, but not in bash
2022-12-12 22:10:49 +00:00

18 lines
336 B
Bash
Executable File

#!/bin/bash
test "$1" = "--help" || test -z "$1" && {
echo -e "usage: rose-mklink <alias> <url>\n"
echo "Create a /usr/bin link to a website."
exit
}
test -z "$2" || {
[ -f "/usr/bin/$1" ] && {
echo "/usr/bin/$1 already exists, remove it first"
exit 1
}
echo -e "#!/bin/sh\n\nrose $2" > /usr/bin/$1
chmod +x /usr/bin/$1
}