Commit d64bda1c authored by Wayne Davison's avatar Wayne Davison

Some quoting fixes/improvements.

parent c6679e04
......@@ -13,7 +13,7 @@ do_cd=y # Default path is user's home dir, just like ssh.
while : ; do
case "$1" in
-l) user="$2"; shift; shift ;;
-l*) user=`echo $1 | sed 's/^-l//'`; shift ;;
-l*) user=`echo "$1" | sed 's/^-l//'`; shift ;;
--no-cd) do_cd=n; shift ;;
-*) shift ;;
localhost) shift; break ;;
......@@ -22,9 +22,9 @@ while : ; do
done
if [ "$user" ]; then
prefix="sudo -H -u $user"
prefix="sudo -H -u '$user'"
if [ $do_cd = y ]; then
home=`perl -e "print((getpwnam("$user"))[7])"`
home=`perl -e "print((getpwnam('$user'))[7])"`
# Yeah, this may fail, but attempts to get sudo to cd are harder.
cd $home
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment