Reputation
Next tag badge:
982/1000 score
233/200 answers
Badges
15 130 270
Newest
 Nice Answer
Impact
~3.7m people reached

1h
comment Rename files (delete some characters that are not always the same)
@ChrisDown, that's what I had in mind when comparing with perl's rename. On this system, the base zsh package takes 1.8MB and the base perl one 17MB. Note that if you only want zmv, you can trim down zsh to include only the modules you want (removing zle alone would save a lot).
1h
comment Rename files (delete some characters that are not always the same)
@ChrisDown, it's nice because it can harness the full power of the zsh language. It's hardly more resource hungry than perl's rename though. You can always have it separately with #! /bin/zsh - autoload zmv; zmv "$@".
1h
comment Rename files (delete some characters that are not always the same)
(note that contrary to zmv, it will not check for potential conflicts, you may want to add a -i).
1h
revised zmv for zsh: Dry runs and man pages
mention info equivalent.
1h
answered Rename files (delete some characters that are not always the same)
3h
answered Bash wildcard to match exactly n characters
3h
answered tar unix not changing directory
3h
revised tar unix not changing directory
added 2 characters in body
4h
comment Extracting subset of lines of a file based on regex for first & last line
@chaos, though an example might help, the question is clearly specified without any ambiguity (the only possible one being whether a line may match both R and S) which is rare enough here to be praised. It certainly doesn't warrant closing as unclear.
4h
reviewed Leave Open Extracting subset of lines of a file based on regex for first & last line
4h
comment Extracting subset of lines of a file based on regex for first & last line
To clarify my earlier comment. You're right that /1/;{blah} was not allowed by POSIX and that was one of the points I raised in my request to the austin group. As Don Cragun notes there, that was not intentional and will be fixed (see the grammar change) so that now you can have any sequence of pattern-less or action-less or pattern-action items provided they are separated by ; or newline.
4h
comment Extracting subset of lines of a file based on regex for first & last line
As for the optimisation gain, that very much depends on the cost of your R regexp. Compare for instance seq 1111111111110000 1111111111119999 | mawk '/(1+1+)+2/,0{if (/9999/) exit; print}' with seq 1111111111110000 1111111111119999 | mawk 'x&&/9999/{exit};x+=/(1+1+)+2/'. I get 3 seconds difference, though the input is only a few kilo-bytes, not tera-bytes.
4h
comment Extracting subset of lines of a file based on regex for first & last line
/1/;{blah} is meant to be allowed by POSIX (and the original awk (not awk 'x+=/R/' though), though POSIX awk is not based on that one but on nawk). It's {blah}/1/ that's not. See the grammar. I take note not to edit your answers in the future.
5h
comment Extracting subset of lines of a file based on regex for first & last line
Actually, I even once filed a request to the Austin group so that restriction be relaxed as I couldn't find any implementation that enforced it but it was rejected by the maintainer of GNU awk. (please also note that my comments are never intended as being confrontational, only at adding information).
5h
comment Extracting subset of lines of a file based on regex for first & last line
the semi-colon is required by POSIX.
5h
revised Extracting subset of lines of a file based on regex for first & last line
POSIXified
5h
comment Extracting subset of lines of a file based on regex for first & last line
It could be optimised by not looking for subsequent Rs like awk '/R/,0{if (/S/) exit; print}'
5h
revised Extracting subset of lines of a file based on regex for first & last line
added 86 characters in body
5h
comment Extracting subset of lines of a file based on regex for first & last line
Your POSIX one is not POSIX (; is a valid character in the name of a label, you need ; before } (and can't have anything after)
5h
answered Extracting subset of lines of a file based on regex for first & last line