The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,268 other subscribers

command line – Why does a cURL request return a percent sign (%) with every request in ZSH? – Stack Overflow

Posted by jpluimers on 2025/07/31

I try to stay on the default shells of environments as much as possible, especially as that makes life easier when needing to work on an non-customised system.

Apple switched back from an ancient latest GPLv2 version 3.2 of bash (they regard newer GPLv3 as toxic to their revenue stream¹), introduced MIT-license based zsh and introduced a bash nag screen a few years ago forcing users to switch. Suppressing that message reliably is trickier than you might think².

After so many years of bash, I still stumble over things that zsh does differently: [Wayback/Archive] command line – Why does a cURL request return a percent sign (%) with every request in ZSH? – Stack Overflow (thanks [Wayback/Archive] Travis and [Wayback/Archive] zaTricky) is a “feature” with a simple workaround for cURL:

This is a zsh feature that prints a percent-and-newline after a command completes if that command does not already include a newline at the end of its output. If zsh did not do this, you would either not ever notice the fact that the command didn’t print a newline – or you’d see zsh’s command prompt not start on the margin and think it was a bug in zsh.

$ curl http://api.macvendors.com/0015c7   
Cisco Systems, Inc%     
$ curl -w '\n' http://api.macvendors.com/0015c7
Cisco Systems, Inc

Since the above example now writes a redirect messages (good bye HTTP, welcome HTTPS), and I very much dislike short command-line parameters, here is version with the long form of the [Wayback/Archive] curl -w or --write-out parameter :

% curl https://api.macvendors.com/0015c7 
Cisco Systems, Inc%
% curl --write-out '\n' https://api.macvendors.com/0015c7
Cisco Systems, Inc

For more on migrating to zsh on MacOS, see:

  1. [Wayback/Archive] Moving to zsh – Scripting OS X
  2. [Wayback/Archive] Moving to zsh, part 2: Configuration Files – Scripting OS X
  3. [Wayback/Archive] Moving to zsh, part 3: Shell Options – Scripting OS X
  4. [Wayback/Archive] Moving to zsh, part 4: Aliases and Functions – Scripting OS X
  5. [Wayback/Archive] Moving to zsh, part 5: Completions – Scripting OS X
  6. [Wayback/Archive] Moving to zsh, part 6 – Customizing the zsh Prompt – Scripting OS X
  7. [Wayback/Archive] Moving to zsh – part 7: Miscellanea – Scripting OS X
  8. [Wayback/Archive] Moving to zsh, part 8 – Scripting zsh – Scripting OS X

--jeroen


¹ see for instance:

² see for instance:

Installing bash from homebrew effectively gets rid of the warning as well on my system. It is easy to do:

brew install bash

[Wayback/Archive] bash — Homebrew Formulae

[Wayback/Archive] Bash – GNU Project – Free Software Foundation

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.