Reputation
111,470
Next tag badge:
399/400 score
103/80 answers
Badges
17 139 280
Newest
 Nice Answer
Impact
~4.0m people reached

May
8
comment How to use [\w]+ in regular expression in sed?
\w was in GNU grep (in the 80s) before being in perl and in GNU emacs probably even before that.
May
8
answered How to use [\w]+ in regular expression in sed?
May
8
revised bash - why does \x0d\x20 erase the line
added 417 characters in body
May
8
comment Checking if a command is a built-in in ksh
Also note that unset being a special builtin, if it fails, that exits the subshell. Your builtin would say that . is not a builtin for instance.
May
8
revised Checking if a command is a built-in in ksh
added 17 characters in body
May
8
comment Checking if a command is a built-in in ksh
Note that if PATH is set to the empty string, it searches for executable in the current directory. So if you have a "mybuiltin" executable file in the current directory, that builtin mybuiltin will return true. Set it to PATH=/no instead. You shouldn't use echo for arbitrary data. Use printf "%s\n" or print -r -- instead.
May
8
answered bash - why does \x0d\x20 erase the line
May
8
revised Delete text from a file using regular expressions
That AT&T sed is pretty bogus and probably not worth mentioning.
May
8
revised Delete text from a file using regular expressions
added 576 characters in body
May
8
comment Delete text from a file using regular expressions
You can also use -0777 in place of BEGIN{$/ = undef}.
May
8
revised Delete text from a file using regular expressions
added 166 characters in body
May
8
comment Delete text from a file using regular expressions
You have <!!!> in one and </!!! in the other. Make up your mind. Also do you mean that those spaces, newlines and "``` have to be removed?
May
8
revised Delete text from a file using regular expressions
added 110 characters in body
May
8
answered Delete text from a file using regular expressions
May
8
comment Overwriting files found by find?
What you save in wall-clock time by running things in parallel you lose in cpu time as parallel has a misfeature in that is spawns a shell ($SHELL, not sh) to run those commands. Also note that it won't work if the file names contain newline characters, or possibly other characters depending on you $SHELL (for instance, it fails to escape = globs in zsh and ^ in the Bourne shell). You may want to run it with SHELL=/bin/sh (or SHELL=/usr/xpg4/bin/sh on Solaris 10 and earlier) to avoid surprises.
May
8
revised Overwriting files found by find?
added 112 characters in body
May
8
answered Overwriting files found by find?
May
8
comment Overwriting files found by find?
No, busybox find doesn't have -execdir, nor does it have standard predicates like -ok or -nouser (so could be considered off-topic here). The OP did use -execdir. With -exec, the answer is wrong though, you'd need to use $(dirname...)/$(basename...) or use the shell's ${var%.gif} form.
May
8
revised Overwriting files found by find?
basename removes the dirname, so you need the (non-standard but common) -execdir, and -- for GNU cp.
May
8
revised Overwriting files found by find?
remove erroneous note about %% being bash specific.