Reputation
118,530
Next tag badge:
98/100 score
37/20 answers
Badges
19 150 297
Newest
 Nice Answer
Impact
~4.8m people reached

Jul
23
revised Grep for a string in file without using pipe
portability note of process substitution.
Jul
23
comment How to influence a bash while loop with a timed global variable?
Note that you can use "EXIT" instead of "0" to make it more self-explanatory. Note that POSIXly it should be kill -s USR1 though kill -USR1 will work as well on most systems covered by U&L (and if the shell is bash)
Jul
23
revised How to influence a bash while loop with a timed global variable?
RANDOM's not sh. Remove the non-portable and unnecessary "s" suffix (yes, I know it was in the OP's as well).
Jul
23
comment Convert ls -l output format to chmod format
Yes, I realised that later, which is why I deleted the comment.
Jul
23
comment Convert ls -l output format to chmod format
Note that seq is not a POSIX command. You may be able to use the ${var#?} operator to avoid expr. Not that LC_COLLATE will not override LC_ALL
Jul
23
comment Convert ls -l output format to chmod format
Sorry about l/L [[, I read too quickly. Yes, -- and ++ are not POSIX. POSIX allows shells to implement them, that means you have to write $((- -a)) if you want a double negation, not that you may use $((--a)) to mean a decrement operation.
Jul
22
awarded  Nice Answer
Jul
22
answered How to grep all xml files that do not begin with “<”
Jul
22
comment Perl script to compare two consecutive lines for the first character and ignore the second line if both first characters are same
AFAIK, BSD doesn't support -w. At least FreeBSD doesn't. That answer is still the best GNU answer. The fact that it doesn't work with GNU uniq now (for multi-byte characters which is not the case in the OP's sample) is a bug there. Hopefully, it will be fixed. May have been already in newer versions. I haven't checked.
Jul
22
comment Perl script to compare two consecutive lines for the first character and ignore the second line if both first characters are same
Note that in the case of GNU uniq (my version 8.23 at least), that help message is misleading as, in effect, it compares N bytes, not N characters. So that won't work properly for multi-byte characters.
Jul
22
answered Perl script to compare two consecutive lines for the first character and ignore the second line if both first characters are same
Jul
22
comment Mount a USB unit via ssh to transfer music using Amarok
Sounds like a XY problem. Why do you want your OS to detect it as a USB drive?
Jul
22
answered Change strings in multiple files to current subdirectory name
Jul
21
revised Is there a command to see where a disk is mounted?
added 243 characters in body
Jul
21
comment Is there a command to see where a disk is mounted?
There now are findmnt and lsblk dedicated commands that do the hard work (more robustly) for you
Jul
21
answered Is there a command to see where a disk is mounted?
Jul
21
revised How to pass argument with char ( in remote path?
added 62 characters in body
Jul
21
revised Can bash write to its own input stream?
added 243 characters in body
Jul
21
revised How to pass argument with char ( in remote path?
added 844 characters in body
Jul
21
comment How to pass argument with char ( in remote path?
That will only work if the login shell of the user on the remote host understands backslash as a quoting operator. Which will be the case in the majority of the cases, but would not be for instance if that shell is rc where the only quoting operator is single quote. Best is to use -s|--protect-args here to have a shell-agnostic solution.