Skip to content

Conversation

@jlec
Copy link
Contributor

@jlec jlec commented Sep 28, 2021

homebrew allows using gnu coreutils on MacOS. Therefore we should
comply with posix standards

$ mas help | tail +3
tail: cannot open '+3' for reading: No such file or directory
$ type tail
tail is /usr/local/opt/coreutils/libexec/gnubin/tail

Switching to posix compliant -n syntax is compatible with UNIX and GNU tooling.

$ mas help | /usr/bin/tail -n +3 | wc -l
18
$ mas help | tail -n +3 | wc -l
18

homebrew allows using gnu coreutils on MacOS. Therefore we should
comply with posix standards

```bash
$ mas help | tail +3
tail: cannot open '+3' for reading: No such file or directory
$ type tail
tail is /usr/local/opt/coreutils/libexec/gnubin/tail
```

Switching to posix compliant `-n` syntax is compatible with UNIX and GNU tooling.

```bash
$ mas help | /usr/bin/tail -n +3 | wc -l
18
$ mas help | tail -n +3 | wc -l
18
```
@phatblat phatblat added this to the Unreleased milestone Oct 20, 2021
Copy link
Contributor

@chris-araman chris-araman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @jlec!

@chris-araman chris-araman enabled auto-merge (rebase) November 2, 2021 04:56
@chris-araman chris-araman changed the title Use posix compliant tail syntax 🐛 Use posix compliant tail syntax Nov 2, 2021
@chris-araman chris-araman changed the title 🐛 Use posix compliant tail syntax 🐛 Use POSIX-compliant tail syntax Nov 2, 2021
@chris-araman chris-araman merged commit 7fe27fc into mas-cli:main Nov 2, 2021
@jlec jlec deleted the posix_tail branch November 17, 2021 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants