Skip to content

portable sed commands#130

Merged
ekalinin merged 1 commit intoekalinin:masterfrom
tedivm:patch-1
Mar 22, 2022
Merged

portable sed commands#130
ekalinin merged 1 commit intoekalinin:masterfrom
tedivm:patch-1

Conversation

@tedivm
Copy link
Copy Markdown
Contributor

@tedivm tedivm commented Mar 22, 2022

The original sed variant detection worked by checking the operating system type- if the OS is darwin (ie, OSX) it uses the BSD sed, otherwise the GNU sed.

This change instead uses "duck typing" to identify the variant. It runs sed --version to detect whether the linux or bsd version is running. On the OSX/BSD version the sed --version command fails, but on the gnu version it succeeds.

This allows the script to work in two cases where it otherwise fails-

  1. For people (like me) who install the updated gnu versions of everything on their OSX machines.
  2. On other BSD style systems.

@ekalinin ekalinin merged commit cd07e56 into ekalinin:master Mar 22, 2022
@ekalinin
Copy link
Copy Markdown
Owner

Thanks!

@tedivm tedivm deleted the patch-1 branch March 22, 2022 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants