On Smart Quotes and Terminal

Typography is a wonderful art and has a long history. When humans turned from manual typesetting to machines, type writers and then computers, some compromises had to be made. One of these compromises was to use simple straight quote symbols for opening and closing the quote, rather than different quote symbols for opening and closing.

Note: which kind of quotes are used for opening and closing dependent on the language or and some convention. English uses upper quotes “…”, German opens with a lower quote: „…“, French uses ‘guillemets:’ «…», and Japanese uses hooks: 「…」

Quotation Marks have funny names in many languages. Germans call them “Gänsefüßchen,” or “little goose feet.”

See this Wikipedia article for more details.

macOS, iOS and other modern operating systems have a feature which replaces the simple or straight quote symbols with the typographic quotes. So, you type "Hello!" and the quotes are automatically replaced with the proper (depending on localization) typographic quotes. This is called “smart quotes.”

This is pretty nice, but can be troublesome when dealing with Terminal and text editors. Scripting languages and shells always use straight quotes, and cannot deal with typographic quotes.

Now, if someone sends you a command or a script that uses quotes, and it goes through an app that replaces them with smart quotes, then bash and Terminal will fail miserably.

There is not much you can do, other than be aware of this and check pasted code carefully. There is something you can do to make this easier, though.

The default monospace font used in Terminal on macOS are ‘Menlo’ or ‘SF Mono,’ depending on the macOS version. Now these are fine typefaces, but their typographic quotes are not very curly at all, making them very hard to distinguish from the ‘dumb’ straight quotes that Terminal expects. The classic ‘Monaco’ typeface on the other hand has beautiful curly typographic quotes, making them very distinct from the the straight quote.

My favorite mono space typeface ‘Source Code Pro’ also has nice curly typographic quotes. I have built this table with many common monospace typefaces and their quotes.

Quotation Mark Comparison
Quotation Mark Comparison

Now this shouldn’t be your only criteria in choosing your Terminal font, but it may be something that helps avoid quote errors.

Weekly News Summary for Admins — 2019-05-03

The big news this week was that Apple has started removing certain iOS applications which allow fine-grained parental controls for their children’s iPhones and iPads. The first post on this in the New York Times speculated that Apple was removing products that compete with Screen Time. However, Apple clarified that these companies are using MDM (Mobile Devices Management servers) to get the features, which is a “guideline violation.”

Since this discussion involves MDM, I believe it is very relevant to Mac and iOS administrators.

You could discuss whether these services should be using MDM to get the feature set their customers desire. You could have (the ever repeating) discussion on how Apple reverses years’ worth of approvals because they now suddenly realize the app has been in violation all along. You could question how fair and reasonable the 30 days ultimatum for an updated app without MDM was, since there is no other API with a similar feature set, and how well the ultimatum was communicated.

But I want to point out that MDM enrollment, both on iOS and macOS, has to be manually initiated the user, and approved with a passcode. This required user approval, is a big hurdle for automated delpoyments, something which administrators are longing for.

The workaround for this, according to Apple is Automated Device Enrollment (formerly known as DEP) where the chain of possession from Apple, through a reseller, to the purchasing organisation is proven and logged in Apple’s servers. Even with DEP, user approval of the management features is necessay at first boot.

There have been cases where malware has installed MDM profiles on iOS and Macs and supposedly user approval should protect from these cases. Yet, when a service or application, which promises a solution the user desires, asks for approval, the user will click anything.

Users are trained to approve these security dialogs. The more dialogs the system throws at the user, the more they are trained to quickly approve and authorize them without really reading or understanding. Too much user approval can be detrimental to its purpose.

MDM servers need certificates from Apple to work. They need to register with the push notification service to communicate with the clients. The client applications that are distributed through the iOS and Mac App Stores, need developer certificates from Apple.

Apple would have many options to control and block malicious actors in this field without hurting legitimate services and administrators seeking automation.

If you would rather get the weekly newsletter by email, you can subscribe to the Scripting OS X Weekly Newsletter here!! (Same content, delivered to your Inbox once a week.)

📰News and Opinion

Parental Control Apps/MDM

🐦MacAdmins on Twitter

  • mikeymikey: “Different techniques, different goals. Internet recovery has been modified multiple times over the years (example change in 10.12.4), whereas netboot was a device independent standard that would have needed a total overhaul for Secure Boot.”
  • Steve Troughton-Smith: “Just 35 days to WWDC! 35 days to iOS apps on the Mac, 35 days to multi-window iPad homescreen revamp, 35 days to Dark Mode on iOS”
  • Steve Troughton-Smith: “Dashboard isn’t the only thing gone in 10.15 — so is 32-bit app & plugin support, Carbon, Ink, QuickTime 7 & QuickTime plugins, PPTP, and hardware RAID. You will get Python 3.7 and Ruby 2.6, at least” (Python 3 alongisde the soon-to be EOL’ed Python 2.7 would be good news.)
  • Emily kw, ph.d.: “Hello. I’m a Sr. Systems Engineer for a Fortune 25 company. I am not interested in your Technical Support Specialist job offers. Goodbye.”

🐞Bugs and Security

🔨Support and HowTos

🤖Scripting and Automation

🍏Apple Support

♻️Updates and Releases

🎈Just for Fun

📚 Support

There are no ads on my webpage or this newsletter. If you are enjoying what you are reading here, please spread the word and recommend it to another Mac Admin!

If you want to support me and this website even further, then consider buying one (or all) of my books. It’s like a subscription fee, but you also get a useful book or two extra!

Weekly News Summary for Admins — 2019-04-26

I am traveling with just my iPad this week, so this is the first time that I am assembling the newsletter entirely on iOS. It has been an interesting challenge. I built a shortcut which copies a page from Safari in Markdown format, something that Byword on Mac does automatically on drag’n drop, but Byword on iOS does not.

If there are any errors or differences in this week’s newsletter because of that, please be tolerant. Since I am traveling and somewhat distracted, there may have been a post or news that I missed. Please tell me and I will add it next week! (Contact info at the end of the letter.)

If you would rather get the weekly newsletter by email, you can subscribe to the Scripting OS X Weekly Newsletter here!! (Same content, delivered to your Inbox once a week.)

News and Opinion

MacAdmins on Twitter

  • Bertrand Pourcel: “Command-IT : la conférence pour les pros du monde Apple”
  • William Lam: “Been getting asked about our progress with ESXi on new 2018 Apple Mac Mini Here’s quick summary …”
  • Ben Toms: “Kernel extensions signed after April 7th, 2019 must be notarized in order to load on macOS 10.14.5.”
  • Kitzy: “So @SlackHQ, an app specifically aimed for enterprise use, doesn’t support enterprise deployment.”
  • Eric Holtam: “TIL about wdutil and sudo wdutil info for showing wireless info.”

Bugs and Security

Support and HowTos

Scripting and Automation

Apple Support

Updates and Releases

Just for Fun

Support

There are no ads on my webpage or this newsletter. If you are enjoying what you are reading here, please spread the word and recommend it to another Mac Admin!

If you want to support me and this website even further, then consider buying one (or all) of my books. It’s like a subscription fee, but you also get a useful book or two extra!

Weekly News Summary for Admins — 2019-04-19

The video for my MacADUK Presentation “Modern Deployment Workflows for Business” is online! You can find the link, the slides and the notes on the permanent presenation page. There is also a link to the entire MacADUK 2019 playlist. There are many great presentations worth watching.

If you would rather get the weekly newsletter by email, you can subscribe to the Scripting OS X Weekly Newsletter here!! (Same content, delivered to your Inbox once a week.)

News and Opinion

MacAdmins on Twitter

  • Tim Perfitt: “Grab any corner of a window of an app in macOS and drag while holding the option key. The window will expand around the center point. Add in shift (so it is now command-shift) and it expands around the center and keeps the aspect ratio.” (Original tweet wrongly states ‘command’ key instead of the correct ‘option’ key.)
  • Joe Bourne: “Support for OS X Mojave has come to Azure Pipelines hosted agents and it includes Xcode 10.2! If you’re using the ‘Hosted macOS’ pool, your pipelines will already start running on Mojave. YAML customers can use ‘macos–10.14’ for their pool VM Image (Link)”
  • Steve Troughton-Smith: “RIP Dashboard, 2005–2019 You will be missed”
  • Rich Trouton: “If you’re a user of First Boot Package Install, there’s a new version available. Same great functionality, but now it’s signed and notarized!”
  • Thomas Reed: “Think Macs can’t get infected with malware? Or that they only get infected with adware and junk software? Think again. Here’s a story involving supply chain attacks, millions of dollars stolen… and Mac malware.”
  • Tim Perfitt: “Adding Munki server and automatic munki client provisioning into MDS 1.7. Also added MunkiAdmin to the toolbar so you can setup, manage and deploy Macs using MDS + Munki without ever touching the command line.…”

Bugs and Security

Support and HowTos

Scripting and Automation

Updates and Releases

To Watch

To Listen

Support

There are no ads on my webpage or this newsletter. If you are enjoying what you are reading here, please spread the word and recommend it to another Mac Admin!

If you want to support me and this website even further, then consider buying one (or all) of my books. It’s like a subscription fee, but you also get a useful book or two extra!

MacADUK 2019 Presentation Video online

The recording of my MacADUK 2019 presentation: “Modern Deployment Workflows for Business” is online and available:

You can find this video and the other recorded presentations in the MacADUK 2019 playlist on YouTube.

I am really happy with how this presentation turned out and I could be more happy with the keyframe that was chosen for the video.

You can find the notes and slides at the session’s permanent page.

Many thanks again to all those who put a lot of effort into making MacADUK 2019 the great conference it was. Also thanks to the attendees with all their great feedback and applause. See you all again next year!

Weekly News Summary for Admins — 2019-04-12

One of the key takeaways from my MacADUK presentation on “Modern Delpoyment Workflows” is that MacAdmins now have to expect new, rules-changing ‘features’ in macOS at any time during the release cycle. (Video is not available yet, I will post when they release it.)

Apple is proving this advice with the announcement that thrid party kernel extensions and certain applications have to be notarized, starting with macOS 10.14.5 beta2.

In typical Apple fashion this announcement is brief and to the point and leaves many questions open for interpretation, especially for MacAdmins. Thankfully, the MacAdmin community has, once again, leapt to action and filled in a few of the critical missing pieces.

Also, we have updated our EraseInstall app! And yes, it is notarized.

If you would rather get the weekly newsletter by email, you can subscribe to the Scripting OS X Weekly Newsletter here!! (Same content, delivered to your Inbox once a week.)

News and Opinion

10.14.5 App Notarization Changes

MacAdmins on Twitter

Support and HowTos

Scripting and Automation

Apple Support

Updates and Releases

To Listen

Support

There are no ads on my webpage or this newsletter. If you are enjoying what you are reading here, please spread the word and recommend it to another Mac Admin!

If you want to support me and this website even further, then consider buying one (or all) of my books. It’s like a subscription fee, but you also get a useful book or two extra!

EraseInstall Update: Version 1.2

We (the team I work with at Pro Warehouse) have released a new version of the EraseInstall application.

Version 1.2 is now notarized, so it should continue to work with macOS 10.14.5 and newer. It also checks the battery level before starting the process and will refuse continue if the battery is low. We also fixed a few layout and other bugs.

Important Update: Because this new version is built with Swift 5, it will require the Swift 5 Runtime Support to be installed as well, when on macOS 10.14.3 and older.

But the big new feature is that you can customize the installation process of the new macOS with custom packages.

The package installers will be installed after the macOS installation is complete but before DEP runs or the first user is created. This allows for some useful customizations and shortcuts in the deployment process.

The EraseInstall application will look for package installers (pkg) files in the /Library/Application Support/EraseInstall/Packages/ folder. When the package installers are in the correct format (see below) they will be added to the startosinstall command with the --installpackage option.

For this to work, the packages have to be ‘distribution packages with an’product archives,’ i.e. distribution packages with the identifier attribute set in the product key.

Most package installers created with tools commonly used by Mac Administrators build component packages (also called ‘flat packages’). These contain the payload files that will be installed on the target system and optional installation scripts to modify the behavior.

If you usually build your packages as component packages with pkgbuild or a similar tool, you can convert them to product archives with the productbuild command:

$ productbuild --package path/to/component.pkg
--version 1.0 --identifier com.example.package productarchive.pkg

If you use a different tool to create your packages, please consult the tool’s manual or support reference whether they create component packages, distribution packages or product archives.
munkipkg: will automatically create product archives when the distribution_style key is set to true
Whitebox Packages: identifier (id) and version can be set for a distribution package project when ‘Show Advanced User Options’ is enabled in Packages -> Preferences
Jamf Composer: cannot create distribution packages or product archives. You can convert the component packages from Composer with the above productbuild command.
pkgbuild and most other tools: creates component packages which you can convert using the above productbuild command

You can use the ‘ShowLanguageChooser’ and ‘SuppressSetupAssistant’ package installers built with these scripts as some examples to start with.

You can download the installer for EraseInstall 1.2 here.

Weekly News Summary for Admins — 2019-04-05

Since I assemble and publish this news summary on Friday mornings (European Time), I sometimes just miss interesting news dropping on Friday afternoon in US. Usually, Friday afternoon news in bad news for the organisation releasing it.

Exactly this happened last Friday. After two weeks of seemingly non-stop releases, on Friday afternoon Apple cancelled the AirPower charging mat which was pre-announced at the iPhone X event in September 2017.

On the other hand, a different pre-announcement made at WWDC last year was fulfilled this week. BBEdit is back in the Mac AppStore! (No secret that BBEdit is my favored text editor, I wrote a bit about why last year.)

Also, the email version of this summary broke through 500 subscribers! Thank you all! (And keep spreading the word.)

We also got a lot of great posts with helpful advice from various MacAdmins. As usual a huge thank you to everyone who so willingly shares their experience.

If you would rather get the weekly newsletter by email, you can subscribe to the Scripting OS X Weekly Newsletter here!! (Same content, delivered to your Inbox once a week.)

#! On Scripting OS X

📰News and Opinion

🐦MacAdmins on Twitter

  • MacDeployment YYC: “Last night at our MacDeploy Meetup, we were pleased to announce our plans for this year’s Conference, June 10–11 here in #yyc. 1/” (Thread)
  • Nigel Kersten: “I don’t think I’ve ever really told the story on Twitter about the time Steve Jobs sent me a polite but dismissive email and then proceeded to make my life at work rather hellish.” (Thread)
  • Eric Holtam: “Munki admins: Apple SUS update testing requested.”
  • Libbi Garret: “Do you use Apple School Manager? Great News! Our amazing F3 Legal Council has worked with Apple Edu and determined that ASM is FERPA & Ed Code 49073.1 (AB1584) compliant! You can view/download the letter and terms on our CETPA page studentprivacy.net
  • Eric Holtam: ‘VMWare Fusion needs a feature to say “Snapshot on the next reboot because I’m going to forget and waste hours of prep time”’
  • Tim Perfitt: “Work is progressing on #MDS 1.6. You can specify variables when creating workflows that causing techs to get prompted and the values are passed to your scripts. This is so awesome you might need to sit down for a bit.”
  • Rene Ritchie: “Apple has dropped its #HomePod price to US$299 (down from US$349). Similar cuts internationally.”
  • Suzana Ilić: “This is really neat! You take a screenshot of an equation, it gives you the LaTeX code, you can directly modify in the taskbar, copy, paste, done. mathpix.com

🐞Bugs and Security

🔨Support and HowTos

🤖Scripting and Automation

🍏Apple Support

♻️Updates and Releases

🎧To Listen

📚 Support

There are no ads on my webpage or this newsletter. If you are enjoying what you are reading here, please spread the word and recommend it to another Mac Admin!

If you want to support me and this website even further, then consider buying one (or all) of my books. It’s like a subscription fee, but you also get a useful book or two extra!

Swift 5 for MacAdmins

macOS 10.14.4 also includes Swift 5. The main new feature of Swift 5 is that Swift is ABI stable.

Simply said, ABI stability allows swift binaries to use a Swift library on the system instead of having to bundle the libraries with them. This will, of course reduce the size of the binaries.

For example, my desktoppr tool compiles to 6.5MB with Swift 4.2 and 56KB with Swift 5.

However, command line tools built with Xcode 10.2 now rely on the Swift library to be available on the system. macOS 10.14.4 and future versions will include the libraries, but older macOS versions did not. There is no option in Xcode 10.2 to keep the old behavior of bundling the libraries in the tool.

This means that when you re-build a tool in Xcode 10.2 with Swift it will not run on older macOS version:

$ sw_vers -productVersion
10.13.6
$ ./desktoppr 
dyld: Library not loaded: @rpath/libswiftAppKit.dylib
  Referenced from: /Users/armin/Desktop/desktoppr
  Reason: image not found
Abort trap: 6

Apple provides an installer for the Swift libraries for “earlier versions of macOS.” (The package installer declares a minimum OS version of 10.9.)

The libraries are installed in /usr/lib/swift, where your binaries can find them:

$ ./desktoppr 
/Library/Desktop Pictures/BoringBlueDesktop.png

Note: these libraries are used by compiled binaries. Installing the runtime libriaries will not allow you to run swift script files, i.e. text files starting with the #!/usr/bin/swift shebang. You still need to install Xcode or the Developer Command Line tools for that.

So far, only command line tools written and compiled in Xcode 10.2 will require the libraries. Application bundles will continue to include their own libraries.

As Swift gets updated, you will need to update the installed libraries as well. You can get the installed version of the Runtime with pkgutil:

$ pkgutil --info com.apple.pkg.SwiftRuntimeForCommandLineTools
package-id: com.apple.pkg.SwiftRuntimeForCommandLineTools
version: 10.2.0.0.1.1552586384
volume: /
location: /
install-time: 1553789052
groups: com.apple.FindSystemFiles.pkg-group 

However, on a Mac with 10.14.4 the swift libraries are present but not installed by the same installer package, they are part of the entire system:

$ pkgutil --file-info /usr/lib/swift/libswiftFoundation.dylib
volume: /
path: /usr/lib/swift/libswiftFoundation.dylib

pkgid: com.apple.pkg.update.os.10.14.4.18E226
pkg-version: 1.0.0.0.1.1553145155
install-time: 1553765876
uid: 0
gid: 0
mode: 755

If/When Apple updates the runtime libraries, this might be a challenge to track and update properly.

Note: While I used my tool desktoppr as an example, I have not updated the version available for download to Swift 5 yet. So, that is still built with the “old” Swift and Xcode and should work everywhere without the runtime libraries.

Nevertheless, it should be prudent for MacAdmins to install the Swift 5 runtime libraries on their fleet. At the very least be aware that these errors can occur and how to fix them.

Weekly News Summary for Admins — 2019-03-29

We did get the long awaited Apple Event this week. Since Apple unloaded many of their releases last week already the event could focus entirely on new subscription services. Apple showed subscription services for magazines (Apple News+), games (Apple Arcade), credit card (Apple Card), and tv series (Apple tv+). Only Apple News+ is available now, the rest will come “later this year.” 10.15 release should be interesting.

More interesting for Apple Admins, the updates for macOS Mojave 10.14.4, iOS 12.2, watchOS 5.2 and tvOS 12.2 were released as well. Since these are the “Spring Updates” they bring with them some new user facing features: Apple News+, dark mode for Safari content, AirPods 2 support. Also some new features for administrators which I already outlined in a post.

Overall, not as big an update as 10.13.4 was, but still quite the event.

Also this week was MacAD.UK, where I presented on “Modern Delpoyment Workflows for Business.” I had a wonderful time meeting everyone at the conference. My thanks to the organizers, speakers and attendees for making this a great event.

If you would rather get the weekly newsletter by email, you can subscribe to the Scripting OS X Weekly Newsletter here!! (Same content, delivered to your Inbox once a week.)

#! On Scripting OS X

📰News and Opinion

🐦MacAdmins on Twitter

🐞Bugs and Security

🔨Support and HowTos

🤖Scripting and Automation

🍏Apple Support

Spring Udpates

Swift 5

Downloads

♻️Updates and Releases

📺To Watch

🎧To Listen

📚 Support

There are no ads on my webpage or this newsletter. If you are enjoying what you are reading here, please spread the word and recommend it to another Mac Admin!

If you want to support me and this website even further, then consider buying one (or all) of my books. It’s like a subscription fee, but you also get a useful book or two extra!