« first day (3221 days earlier)      last day (1738 days later) » 

7:03 AM
@terdon You are not missing anything. for ..; do ...; done < $(command)` would only work if the command generated a word that is a filename.
@terdon The word following a redirection operator is (in bash) subject to word splitting. This is why the redirection becomes ambiguous with seq 2 but not with seq 1.
... just as if you had used < *.txt where *.txt matches more than one filename.
@terdon Unless he has a file with a filename that happens to be the contents of test.html with its lines reversed, that should give him a "No such file or directory" error.
 
 
4 hours later…
10:44 AM
@terdon Excellent. I'm glad you were able to inform the post author.
@terdon I think a separate list of shells may be better, either in checkshell itself or its own file. /etc/shells can have conceptual non-shells (/usr/bin/screen and /usr/bin/tmux), the same shell with the same behavior (/bin/zsh vs. /usr/bin/zsh), the same shell with different names/behavior that you may prefer not to test with (/bin/bash` vs. /bin/rbash), and may not have shells that are good to test with like busybox ash and any installed in your home directory for testing.
Well, that formatting is not great, sorry. (I sat back down and it was just too late to edit it.)
 
11:45 AM
@EliahKagan Yeah, true. On the other hand, I don't want to be maintaining a list of this. I'd rather get the shells from the system. I might implement a list of shells to exclude though. And the dupes aren't a problem, I already uniq them.
 
I was thinking along the lines of @Jesse_b's idea that it might be good to keep some of the dupes.
If /etc/shells is to be used, how do you feel about the idea of excluding shells that aren't named like shells (no "sh" in the name--this takes care of stuff like screen) and whose executable is binary-identical to some higher-listed shell? Maybe something like:
tryshells() {
    local shell

    grep -E '^/[^ ]*[^ /]+sh[^ /]*$' /etc/shells |
        xargs sha256sum 2>/dev/null |
        awk 'BEGIN { print "/bin/sh" } !history[$1]++ { print $2 }' |
        while IFS= read -r shell
    do
        printf '%-35s ' "$(printf '\e[01;32m%s\e[0m:' "$shell")"
        "$shell" -c "$@"
    done
}
I special-cased /bin/sh since presumably one wants to test with it even if it's the same as some other shell, and also test with that shell, whose behavior may differ when not so-named.
Actually reading every byte of every shell listed feels like overkill, but /etc/shells tends to be real short, so I think it's reasonable. This does exclude the restricted-shell versions of common Bourne-style shells, though. Personally I wouldn't usually want to test with those, but you might.
 
12:41 PM
Heh, nice. But yeah, might be a bit of overkill. This is only something I run every now and then to test an answer, after all :)
 
 
7 hours later…
7:53 PM
Hi @Caleb. I noticed that you are working on SILE. How are things going with that, and how are future plans?
 

« first day (3221 days earlier)      last day (1738 days later) »