83,778 reputation
1092199
bio website
location European Union
age
visits member for 2 years
seen 3 hours ago

Aug
12
comment Convert a number of seconds elapsed to date from arbitrary start date
Note that GNU date uses the Gregorian calendar (for all dates).
Aug
12
revised Convert a number of seconds elapsed to date from arbitrary start date
added 281 characters in body
Aug
12
answered Convert a number of seconds elapsed to date from arbitrary start date
Aug
12
comment Bash history in script: `!#:*`
@chthonous, if you know it's about history, in info bash, type i (to bring the index), enter hist and press Tab twice to bring up the list of related topics.
Aug
12
comment Why is my trap not printing any log message?
Note that you can't trap SIGKILL (9), that's the whole point of that signal (kill unconditionaly).
Aug
12
revised Why is my trap not printing any log message?
edited title
Aug
12
revised print capital words in first column of file
added 580 characters in body
Aug
12
comment print capital words in first column of file
Where are the dots at the end of VDD. and VMEASPOS. meant to come from?
Aug
12
comment Sorting ls output by time, when there are too many files for a single invocation
(you mean ls -t?). You can use lstat() or do -l; -M _. Also note that -M doesn't support sub-second precision. You can use the stat from Time::HiRes for that. Note that lstat was only very recently added to Time::HiRes.
Aug
12
comment Sorting ls output by time, when there are too many files for a single invocation
@kasperd, (GNU) sed -z 's/^[^ ]* //' or tr '\0\n' '\n\0' | cut -d ' ' -f2- | tr '\0\n' '\n\0'
Aug
12
comment print capital words in first column of file
Note that it doesn't match ABC (nor ABC_DEF) in ABC_DEF ghi (not clear if it should from the question though).
Aug
12
comment print capital words in first column of file
Even in a typical en_US.utf8 locale, [A-Z] matches É as well, and Ý, but not Ź. It's also been known to match b on some systems. Which is why I say that A-Z only makes sense in the POSIX/C locales where it is equivalent to [ABCDEFGHIJKLMNOPQRSTUVWXZ].
Aug
12
revised print capital words in first column of file
added 106 characters in body
Aug
12
comment print capital words in first column of file
And matches at the transition between a [[:alnum:]_] and [^[:alnum:]_] (or the eol) while $1 prints up to the first blank (or eol).
Aug
12
answered print capital words in first column of file
Aug
12
comment print capital words in first column of file
@Gnouch, -o is a GNU extension. -w however though not standard is widespread and I believe predates GNU grep.
Aug
12
revised print capital words in first column of file
`^` needs quoted in many shells (Thomson, Bourne, zsh, fish, rc, es...) A-Z only makes sense in the C/POSIX locale.
Aug
12
revised Sorting ls output by time, when there are too many files for a single invocation
added 190 characters in body
Aug
12
comment Sorting ls output by time, when there are too many files for a single invocation
@hvd, the **/* syntax was invented by zsh in the early 90s, decades before bash copied (a subset of) it. See The result of ls * , ls ** and ls *** for more historical details of that globbing operator. zsh 1991, ksh93 2003, fish 2005, bash 2009, tcsh 2010.
Aug
12
comment Bash: Float to Integer
But float=-2; echo "($float+0.5)/1" | bc gives -1.