aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-31 13:12:17 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-31 13:12:17 +1300
commit870ccd17ef1b1d4b94ba13b5140130306dac51c7 (patch)
treec4e9b2628070da6bf215efcb785fdbb9fbe47008
parentStrip trailing slashes from sd() target (diff)
downloaddotfiles-870ccd17ef1b1d4b94ba13b5140130306dac51c7.tar.gz
dotfiles-870ccd17ef1b1d4b94ba13b5140130306dac51c7.zip
Add a cheeky error message to sd()
-rw-r--r--sh/shrc.d/sd.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/sh/shrc.d/sd.sh b/sh/shrc.d/sd.sh
index a901bb51..10597832 100644
--- a/sh/shrc.d/sd.sh
+++ b/sh/shrc.d/sd.sh
@@ -49,6 +49,12 @@ sd() {
# Read sole optional argument
case $1 in
+ # Root has no siblings
+ /)
+ printf >&2 'sd(): Radical misunderstanding\n'
+ return 2
+ ;;
+
# Slashes aren't allowed
*/*)
printf >&2 'sd(): Illegal slash\n'