From ad437e88602b09c2d7aae637b9828a498fa22ff6 Mon Sep 17 00:00:00 2001 From: daninthewoods Date: Thu, 2 Aug 2018 11:58:49 -0400 Subject: [PATCH] Support for group names containing spaces (#245) When Active Directory is used for Mac authentication then the group name could be "MyCompany\Domain Users". This causes an error in z during the chown such as "chown: MyCompany\Domain: illegal group name" --- z.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/z.sh b/z.sh index 4fc75dc..258ca61 100644 --- a/z.sh +++ b/z.sh @@ -89,7 +89,7 @@ _z() { if [ $? -ne 0 -a -f "$datafile" ]; then env rm -f "$tempfile" else - [ "$_Z_OWNER" ] && chown $_Z_OWNER:$(id -ng $_Z_OWNER) "$tempfile" + [ "$_Z_OWNER" ] && chown $_Z_OWNER:"$(id -ng $_Z_OWNER)" "$tempfile" env mv -f "$tempfile" "$datafile" || env rm -f "$tempfile" fi