Quotes in bash/zsh on a Mac

133 views
Skip to first unread message

Ross Scroggs

unread,
Jun 11, 2021, 9:09:03 AM6/11/21
to google-ap...@googlegroups.com
Someone wrote about zsh on a Mac not properly hamdling an OU name containing a space.
This is a smart (curly) quotes issue usually caused by commands being entered in TextEdit and copied/pasted into Terminal.

Straight quotes - these are recognized by bash and zsh
gam info ou "/Students/Middle School"
gam info ou '/Students/Middle School'

Smart (curly) quotes - these are not recognized by bash and zsh
gam info ou “/Students/Middle School”
gam info ou ‘/Students/Middle School’

In TextEdit, open Preferences... and uncheck Smart quotes

Ross


Ian Crew

unread,
Jun 11, 2021, 10:13:03 AM6/11/21
to google-ap...@googlegroups.com
Or, if you’re doing a lot of this sort of thing, switching to a more-powerful text editor is also a good idea. Personally, I’m a massive fan of BBEdit. 

Cheers,

Ian

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/DC301D21-8493-4DC4-BCE1-64627E76D51E%40gmail.com.
--
Ian Crew

Solutions Architect
Productivity & Collaboration Services
Information Services and Technology

Brian Kim

unread,
Jun 14, 2021, 3:23:49 PM6/14/21
to GAM for Google Workspace
Google Docs does the same thing!  Trying to use git more because of that.

Maj Marshall Giguere

unread,
Jun 14, 2021, 3:33:00 PM6/14/21
to google-ap...@googlegroups.com
Have you tried  /xxxx/yyyy/aaaa\ bbbbb  to escape the space.  Sounds like it's being gobbled by the shell.

Maj Marshall E. Giguere, CAP
NH Wing Director of IT
U.S. Air Force Auxiliary
 


Ross Scroggs

unread,
Jun 14, 2021, 3:50:23 PM6/14/21
to google-ap...@googlegroups.com
The curly quotes don't work in any case, the fact that you might be trying to guard a space doesn't matter.
In the shells, foo bar "1234" has three arguments: foo bar and 1234; the straight quotes are stripped.
In the shells, foo bar “1234” has three arguments: foo bar and “1234”; the curly quotes are not stripped which isn't what you want.

Ross



--

Kim Nilsson

unread,
Jun 17, 2021, 10:53:36 AM6/17/21
to GAM for Google Workspace
nano, mcedit and Visual Studio Code also don't introduce weird quotations.

Peter Smulders

unread,
Jun 23, 2021, 5:14:55 AM6/23/21
to GAM for Google Workspace
vim doesn't either. :) #greybeard #gitofmerlawn

--peter

Reply all
Reply to author
Forward
0 new messages