Reputation
275
Top tag
Next privilege 300 Rep.
Create new tags
Badges
2 9
Impact
~953 people reached

Mar
28
comment `command .*` acts on the parent directory
@NateEldredge: Yup, I'm aware. (Hence extglob, globstar, etc.) But the specs don't seem to use that term; they just say "filename expansion", so that's what I stuck with in my comment. (By the end of #5, I was really nearing the character limit -- no room for any unnecessary facts. :-P )
Mar
28
comment `command .*` acts on the parent directory
@Izkata: Not exactly. It's complicated. See my comment. (Or alternatively, see pubs.opengroup.org/onlinepubs/009695399/utilities/…: "the exclamation mark character ('!') shall replace the circumflex character ('^') in its role in a 'non-matching list'".)
Mar
28
comment `command .*` acts on the parent directory
@trlkly: 1. POSIX regexes are different from (say) Perl-style ones. 2. But [^.] does have the appropriate meaning in a POSIX regex. 3. But POSIX filename-expansion doesn't use the same rules as POSIX regex. (If it did, then .* would mean "zero or more characters" rather than "a dot, plus zero or more characters".) 4. And in POSIX filename-expansion, you have to write [! rather than [^ -- the meaning of the latter is unspecified. 5. But the question specifically calls out Bash, not a generic POSIX shell, and Bash filename-expansion does support [^ as equivalent to [!.
Feb
21
awarded  Autobiographer
Feb
1
revised Pipes, how do data flow in a pipeline?
the right way to share the best answer is to accept it (as you have done), not to incorporate it into the question as a postscript.
Feb
1
suggested approved edit on Pipes, how do data flow in a pipeline?
Jan
4
comment Why is using && 75 times faster than if…fi and how to make code clearer
Good to know; thank you!
Jan
4
comment Why is using && 75 times faster than if…fi and how to make code clearer
Sorry, but your reply seems to assume that I already have a detailed knowledge of shell support for (( ... )). I'm flattered, but I do not have that detailed knowledge. (Remember, I'm the one who just asked if (( ... )) is less portable.) So I really can't make sense of your reply. :-/ Could you be a bit more explicit?
Jan
4
comment Why is using && 75 times faster than if…fi and how to make code clearer
What's the advantage of [ "$((...))" -eq "$((...))" ] over (( (...) == (...) ))? Is the latter less portable?
Dec
18
awarded  Scholar
Dec
18
accepted How do I use null bytes in Bash?
Dec
18
revised How do I use null bytes in Bash?
rephrased a bit more honestly
Dec
13
awarded  Self-Learner
Dec
13
comment Is space not allowed in a filename?
@terdon: Since you never posted the question, I've taken the liberty of posting a self-answered one: unix.stackexchange.com/q/174016/12378. Please let me know if you have any feedback on it.
Dec
13
awarded  Student
Dec
13
asked How do I use null bytes in Bash?
Dec
13
answered How do I use null bytes in Bash?
Oct
26
comment Dash equivalent of self-redirection of script output
@mikeserv: Re: "it works in any shell": Not true. I tried your original example in Bash, Dash, and Zsh, and it worked only in Dash. (N.B. This was on Cygwin, which is what I had handiest. I can check more typical environments, namely Ubuntu and RHEL5, if desired.) Also, echo ... | tee -a /dev/fd/0 didn't work in any of the three (tee: /dev/fd/0: Permission denied), but that doesn't surprise me; I'm guessing you really meant echo ... | tee -a /dev/fd/1, which worked in all of them.
Oct
26
comment Dash equivalent of self-redirection of script output
@mikeserv: Not just heredocs, but also /dev/fd/3 (in that precise form), and the details of what happens to whitespace . . . and for that matter, the fact that this whole approach works at all in Dash, when it doesn't work in other shells that have all of the components, means that the overall approach is a special rule to remember. (This reminds me of attempts to create a simplified English with less vocabulary; they cut out words like persist, but they ignore just-as-difficult idioms like keep on.)
Oct
25
comment Dash equivalent of self-redirection of script output
@mikeserv: It involves plenty of rules to remember; perhaps you have simply grown so used to them that you don't notice.