Reputation
106,541
Next tag badge:
980/1000 score
233/200 answers
Badges
15 129 268
Newest
 vim
Impact
~3.7m people reached

Mar
9
comment execute a script with some permission
(hi Janis, welcome to Unix.SE BTW. Note that one advantage of SE over usenet is that one can more easily delete/amend one's answers)
Mar
9
comment Is it possible to redirect the output of a command into more than one command?
Note that process substitution was introduced by ksh88.
Mar
9
comment Bash Shell Script Array Length Off By One
Note that read fails when it doesn't read a newline character. It may fail and assign a non-empty string if the input ends in a non-terminated line. Like in printf foo | read line.
Mar
9
comment How can I capture the common characters between two strings
There's a sed solution in that other question
Mar
9
revised How can I capture the common characters between two strings
Need quotes. Otherwise the RHS is treated as a pattern
Mar
9
comment How do I loop over output from shuf?
I'm just point out. The split+glob operator behaviour depends on the content of that variable, so it's worth point it out when recommending its usage for anyone stumbling on the answer.
Mar
9
comment How do I loop over output from shuf?
Either way, that assumes you've not modified $IFS, that is, that it still contains the newline character and doesn't contain decimal digits.
Mar
8
comment Is it possible to redirect the output of a command into more than one command?
See also pee from moreutils.
Mar
7
comment how to modify matches to a regular expression with sed or another tool?
@Costas, in GNU BRE only. In standard BRE, there's no \? nor \+.
Mar
7
comment how to modify matches to a regular expression with sed or another tool?
sed 's/,[0-9]\{1,2\}/&)/g'. @Costas, \? is GNU specific. The portable/standard equivalent is \{0,1\}.
Mar
6
comment Writing a character N times using the printf command
With tcsh or zsh, repeat 5000 printf H is easier to understand. With perl: print "H" x 5000 (note that that {1..5000} is a zsh operator inspired by perl's 1..5000 one and later copied by ksh93 and bash)
Mar
6
revised Replacing white-space / characters with backslashes
best to use a ./ prefix to avoid problems with filenames starting with -
Mar
6
comment Replacing white-space / characters with backslashes
Or use zsh that doesn't have all those misfeatures: for i (./*.mkv) ffmpeg -i $i -vcodec copy -acodec copy $i:r.mp4
Mar
6
comment Why do du's subdirectory values not sum up to total?
Also ls -Slh doesn't count hidden files in "total" (add -a) and counts all hard links to a same files so can't be used for disk usage.
Mar
5
answered Simple method to find the number of seconds between two (non-standard) date formats?
Mar
5
revised Simple method to find the number of seconds between two (non-standard) date formats?
missing quotes, TZ needs to be exported for `date`
Mar
5
revised shell script to auto kill processes matching certain criteria
added 24 characters in body
Mar
5
revised Counting files commands in a loop
added 1 character in body
Mar
5
revised Counting files commands in a loop
revert quotes, as some systems will have leading space in the output of wc and a "[" implementation that chokes on it (that assumes an unmodified IFS though)
Mar
5
revised Counting files commands in a loop
added 410 characters in body