82,512 reputation
1090194
bio website
location European Union
age
visits member for 1 year, 11 months
seen 46 mins ago

Aug
6
comment why is EXPORT PS1 in my .profile getting clobbered?
Then that's probably where PS1 is (and should be) defined.
Aug
6
revised How do I suppress a warning message?
added 12 characters in body
Aug
6
comment Shortcut to google selected text
You could configure xbindkeys to do a firefox "$(xsel)" upon a key or mouse button press combination. Then that'd work from any application.
Aug
6
comment Cant ssh, connection terminates immediately with exit status 254
Do you have any other file (FTP/HTTP...?) or shell (console?) access to the machine which you can use?
Aug
6
comment Command-line editing and wrapping
What was that prompt? Maybe that can be reported as a bug to postgresql/libedit.
Aug
6
comment Using a command's output in printf in ksh
wc doesn't read the whole size either if the file is a regular file (in all except old obscure implementations like old busybox ones)
Aug
6
comment Using a command's output in printf in ksh
Yes, though unfortunately -- will not always be enough here. For instance it still won't work for a file called -. Which is why I'd recommend to use the portable wc -c < "$0" which has none of those issues (that gives a different result for symlinks though and would fail if you don't have read permission to the file). See also stat -c %s - < "$0"
Aug
6
comment Using a command's output in printf in ksh
Note that ksh (as in the question's title) often suggests non-GNU systems. There are a number of different stat commands. The stat -c %s syntax is specific to GNU stat
Aug
6
revised Using a command's output in printf in ksh
added 31 characters in body
Aug
6
revised Parsing arbitrary natural language dates under BSD
added 370 characters in body
Aug
6
revised Parsing arbitrary natural language dates under BSD
added 236 characters in body
Aug
6
comment Parsing arbitrary natural language dates under BSD
With the FreeBSD I'm trying this on (9.1-RELEASE-p2) next thursday -1 week gives me tomorrow. And actually, it gives me random results for any timezone other than UTC, so I'll have to add a warning about that in my answer.
Aug
6
revised Using a command's output in printf in ksh
added 27 characters in body
Aug
6
comment Find the total size of certain files within a directory branch
With xargs, several du -a may be run, so you may have discrepancies if there are hard links.
Aug
6
comment Find the total size of certain files within a directory branch
I'd bet the du --file0-from took longer because you ran it first (caching effect).
Aug
6
comment Find the total size of certain files within a directory branch
Note that both assume a GNU system. The first one assumes file names don't contain newline characters.
Aug
6
revised Print all lines between a searched pattern of a text file to different file
added 127 characters in body
Aug
6
answered Using a command's output in printf in ksh
Aug
6
comment Determining the exit status of the “return” built-in
@val0x00ff, no, return defaults to return "$?" (that is, it returns with the exit status of the last run command).
Aug
6
comment Parsing arbitrary natural language dates under BSD
You can also do date -d 'next sunday -1 week' (though that doesn't work with the fifolog_reader of my answer).