Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Abort if the cd fails.
[rsync/rsync.git]
/
support
/
lsh
diff --git
a/support/lsh
b/support/lsh
index
8ccc5a2
..
b63444e
100755
(executable)
--- a/
support/lsh
+++ b/
support/lsh
@@
-24,10
+24,12
@@
if [ "$user" ]; then
prefix=''
if [ $do_cd = y ]; then
home=`perl -e "print((getpwnam('$user'))[7])"`
prefix=''
if [ $do_cd = y ]; then
home=`perl -e "print((getpwnam('$user'))[7])"`
- prefix="cd '$home'
;
"
+ prefix="cd '$home'
&&
"
fi
sudo -H -u "$user" sh -c "$prefix $*"
else
fi
sudo -H -u "$user" sh -c "$prefix $*"
else
- [ $do_cd = y ] && cd
+ if [ $do_cd = y ]; then
+ cd || exit 1
+ fi
eval "${@}"
fi
eval "${@}"
fi