Reputation
155,402
Next tag badge:
769/1000 score
208/200 answers
Badges
23 242 425
Newest
 Necromancer
Impact
~8.6m people reached

57m
awarded  Necromancer
2h
revised Finding files and directories with different umask
added 85 characters in body
3h
revised Finding files and directories with different umask
added 148 characters in body
3h
revised Finding files and directories with different umask
added 571 characters in body
4h
answered Finding files and directories with different umask
18h
comment Regex in find - OS X
@user14492, check edit
18h
revised Regex in find - OS X
added 859 characters in body
18h
awarded  Enlightened
19h
answered Regex in find - OS X
19h
awarded  Nice Answer
20h
revised How to run a command at an average of 5 times per second?
added 1032 characters in body
1d
awarded  Enlightened
1d
awarded  Nice Answer
1d
comment How to run a command at an average of 5 times per second?
@Benjamin. It's not critical. It will only make a different if your $cmd does use $0 (why would it?) and for error messages. Try for instance with cmd=/; without the second sh, you'd see something like y: 1: y: /: Permission denied instead of sh: 1: sh: /: Permission denied
1d
revised How to run a command at an average of 5 times per second?
deleted 3 characters in body
1d
comment How to run a command at an average of 5 times per second?
@Benjamin That second sh is for the $0 in your $cmd script. It's also used in error messages by the shell. Without it, $0 would be y from yes, so you'd get error messages like y: cannot execute cmd... You could also do yes sh | pv -qL15 | xargs -n1 -P20 sh -c "$cmd"
1d
revised How to run a command at an average of 5 times per second?
added 492 characters in body
1d
revised How to run a command at an average of 5 times per second?
added 492 characters in body
1d
answered How to run a command at an average of 5 times per second?
1d
comment dd: multiple input files
@StevenPenny, leaving the expansion unquoted is asking the shell to split+glob it which wouldn't make any sense here. The split part being done on the current value of $IFS. That's irrespective of the content of the variable/expansion. See also Security implications of forgetting to quote a variable in bash/POSIX shells