summaryrefslogtreecommitdiff
path: root/xsh
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2016-10-22 15:37:16 +0200
committerJonas Smedegaard <dr@jones.dk>2016-10-22 15:38:50 +0200
commit39bbb9a8ca83689942ad6857202309523b1f33b4 (patch)
tree5bd7ce389a10dee538c14a908d3d7bb08a730c7c /xsh
parent6894d585ff50ed1f48e973f358c5171fb08fa87f (diff)
Tidy set fallback shell.
Diffstat (limited to 'xsh')
-rwxr-xr-xxsh6
1 files changed, 2 insertions, 4 deletions
diff --git a/xsh b/xsh
index 1391640..3fa48e9 100755
--- a/xsh
+++ b/xsh
@@ -44,6 +44,8 @@ while [ $# -gt 0 ]; do
shift
done
+[ $# -gt 0 ] || set -- /bin/bash
+
# Split program name from its options
if [ $# -gt 0 ]; then
prg_base=$1
@@ -56,10 +58,6 @@ if [ "$V" = 1 ]; then
prg_opts="$prg_opts; sleep 4"
fi
-if [ -z "$prg_base" ]; then
- prg_base='/bin/bash'
-fi
-
prg="$prg_base $prg_opts"
prg_su="echo -n 'Changing to root...: '; su -c \"cd; $prg\""
prg_sudo="sudo -i -- $prg"