Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with other shells #3

Open
jirutka opened this issue Feb 23, 2018 · 1 comment
Open

Compatibility with other shells #3

jirutka opened this issue Feb 23, 2018 · 1 comment

Comments

@jirutka
Copy link

jirutka commented Feb 23, 2018

Definitely works in Bash and Zsh. Probably works in most other shells?

No, it does not work in any other shells; due to:

git-self-blame:90:

paste -d ' ' <(for _ in $(seq 1 "$(wc -l < "$intermediate_tmpfile")"); do echo "$myself"; done) "$intermediate_tmpfile" > "$mailmap_tmpfile"

<(…) (Process Substitution) is so-called bashism – it’s not specified by POSIX Shell Command Language and (as I know) the only shells that implements it is Bash and ZSH. ash, dash, ksh, … or any other POSIX-compatible shell does not implement this syntax.

This is the only problematic part, the rest of the script is POSIX-sh compliant.

@JacobEvelyn
Copy link
Owner

Thanks, @jirutka! I confess I'm relatively new to shell scripting and don't completely understand how the POSIX standard interacts with what different shells actually support. It looks like you're right that not every shell supports process substitution although I don't totally trust that Wikipedia feature table since on my Mac all of the shells that come installed (bash, zsh, ksh, and tcsh... /bin/sh is a clone of /bin/bash and /bin/csh is a clone of /bin/tcsh) seem to support this.

I'm happy to change this though (or accept a PR to change it if you want to take a crack at it). Am I correct that the best way to change this would be to use a temp file (basically alternative #1 in Wikipedia since the named pipe approach would require a scheme to generate random names for pipes so that two of these processes can be run concurrently? Or is there a better/easier approach?

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

No branches or pull requests

2 participants