Reputation
7,439
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
14 25
Newest
 Nice Answer
Impact
~262k people reached

Mar
6
comment Why is a variable passed to the su command, but not an array from the same scope?
No. When piped to xxd, the double quotes correspond to 22 in hex.
Mar
5
comment Simple method to find the number of seconds between two (non-standard) date formats?
@Janis: Note that for existing times, the script answers the question.
Mar
5
comment Simple method to find the number of seconds between two (non-standard) date formats?
@Janis: If the times come from a different timezone than the locally (configured) one, this could break. Try TZ=America/New_York date -d 'Mar 8 02:00:00 2015'
Mar
5
answered Simple method to find the number of seconds between two (non-standard) date formats?
Mar
5
comment Simple method to find the number of seconds between two (non-standard) date formats?
Irrelevant? Are you aware that Daylight Saving Time changes don't happen at the same moment in all the timezones?
Mar
5
comment Simple method to find the number of seconds between two (non-standard) date formats?
Difference in what time zone?
Mar
5
answered How can I capture the common characters between two strings
Mar
5
comment Why is a variable passed to the su command, but not an array from the same scope?
Pardon? ${var[@]} should do word splitting according to the documentation (see man bash).
Mar
4
comment Why is a variable passed to the su command, but not an array from the same scope?
Yes. BASH_VERSION=4.2.53(1)-release, OpenSUSE 13.1.
Mar
4
comment Why is a variable passed to the su command, but not an array from the same scope?
Strange. I'm getting two: -c: line X: syntax error: unexpected end of file
Mar
4
comment Why is a variable passed to the su command, but not an array from the same scope?
su is probably clever enough to glue the parts back together.
Mar
4
comment Why is a variable passed to the su command, but not an array from the same scope?
@GreggLeventhal: You're right. Does it work with a @, though?
Mar
4
comment Why is a variable passed to the su command, but not an array from the same scope?
@GreggLeventhal: Did you replace the @ in double quotes, right?
Mar
4
answered Why is a variable passed to the su command, but not an array from the same scope?
Mar
2
answered Sed alternative for search and replace on very long lines
Mar
2
comment Source code of the patches for Shellshock
ftp.gnu.org/gnu/bash/bash-4.3-patches
Feb
20
comment eval limitation with piped commands
You can shorten grep -v this | grep -v that to grep -v 'this\|that'.
Feb
20
comment How to format decimal number to display the preciding zero but not the trailing ones?
@Vesnog: Parameter substitution would be faster than sed. Also, the second substitution makes no sense (there can't be anything after the end of line).
Feb
20
revised How to format decimal number to display the preciding zero but not the trailing ones?
added 25 characters in body
Feb
20
comment How to format decimal number to display the preciding zero but not the trailing ones?
@Vesnog: There's no regex. It just replaces . at the beginning with 0..