4,694 reputation
11323
bio website keith-s-thompson.github.com
location San Diego, CA
age 54
visits member for 2 years, 11 months
seen 12 hours ago

I'm a programmer and all-around nerd living in San Diego, California.
I work at JetHead Development Inc.

E-mail: Keith.S.Thompson@gmail.com


Jan
18
comment sh script will not execute as root (cron)
The fact that you put the word PROPERLY in all-caps frankly makes me wonder whether you've really added the script to your crontab properly. Can you show us the relevant crontab entry?
Jan
18
revised sh script will not execute as root (cron)
Formatting
Jan
16
comment Why does the bell character have a limit?
There's something called "bell urgency", visible as "Enable Bell Urgency" in xterm's middle-click menu and as the BellIsUrgent resource. I'm not sure whether that's relevant.
Jan
16
answered Why does the bell character have a limit?
Jan
9
comment Emacs's <C-l> vim equivalent
That's not equivalent. vim's H, M, and L keep the same text on the screen, just moving the cursor to the appropriate line in the file. The emacs Control-L keeps the cursor on the same line in the file, shifting the portion of the file that you're seeing (like vim's various z commands mentioned in Luis's answer.
Jan
9
comment Should my /usr/local/bin be 700 permissions?
Or perhaps 775 if you want to have a non-root group with permission to update it.
Dec
19
comment Grep lines but let the first line through
@l0b0: Sorry, I mistyped; it printed the header line last.
Dec
18
comment Grep lines but let the first line through
Not particularly, but there are solutions like terdon's df -h | sed -e 1b -e '/^\/dev/!d' that only invoke df once. The df command can hang in some circumstances; in that case, invoking it just once is probably better.
Dec
18
comment Grep lines but let the first line through
Not bad, but it has the disadvantage that it invokes df twice.
Dec
18
comment Grep lines but let the first line through
I just tried that; it printed the header line first.
Dec
17
comment Convert a .docx to a .pdf with pandoc
@derobert: Running iconv directly on a .docx file is unlikely to work. iconv assumes that its input is a text file in some specified or inferred format. A .docx file is actually a zip file (a compressed archive) containing (mostly) xml files. You might conceivably have some luck unzipping the .docx file, running iconv on the constituent files, and then re-zipping everything back into a new .docx, but I wouldn't bet on it working. For one thing, the xml file containing the actual content of the document specifies its encoding: encoding="UTF-8", for example.
Dec
14
comment Why is it better to use “#!/usr/bin/env NAME” instead of “#!/path/to/NAME” as my shebang?
If it doesn't work with /usr/bin/perl, I'll find out very quickly, and it's the system owner/administrator's responsibility to keep it up to date. If you want to run my script with your own perl, feel free to grab and modify a copy or invoke it via perl foo. (And you might consider the possibility that the 55 people who upvoted this answer also know a thing or two. It's certainly possible that you're right and they're all wrong, but that's not the way I'd bet.)
Dec
14
comment Why is it better to use “#!/usr/bin/env NAME” instead of “#!/path/to/NAME” as my shebang?
@GoodPerson: Suppose I write a Perl script to be installed in /usr/local/bin. I happen to know that it works correctly with /usr/bin/perl. I have no idea whether it works with whatever perl executable some random user happens to have in his or her $PATH. Maybe somebody is experimenting with some ancient version of Perl; because I specified #!/usr/bin/perl, my script (which the user doesn't necessarily even know or care is a Perl script) won't stop working.
Dec
6
comment Pronunciation for /usr directory
Some years ago, at a previous job, I worked on Unix systems with the usual /usr et al setup, and with users' home directories under /user. In that context, pronouncing /usr as "slash user" would not have been a good idea. But I've never seen /user used that way before or since, so it was probably an unusual case.
Dec
4
comment Is it possible to redefine the tilde ('~', home directory)?
Use vipw (or whatever GUI your OS provides) rather than editing /etc/passwd directly. Direct editing risks corrupting the file, which can be difficult to recover from.
Dec
2
comment Cronjob for rebooting everyday
@Michael Kjörling: >& and &> both work in bash; only >& works in csh and tcsh. Since the question uses &>, and csh and tcsh aren't relevent, I've deleted the reference to them.
Dec
2
revised Cronjob for rebooting everyday
`&>` doesn't work in csh and tcsh; remove reference to them.
Nov
23
revised How to conditionally do something if a command succeeded or failed
added 404 characters in body
Nov
21
comment How to pipe the result of a grep search into a new vi file
In fact there's no such thing as a "vi file". vi operates on arbitrary text files; the files themselves are not directly associated with vi. (Or, as I just learned, vi - will cause vi to operate on the contents of stdin; vim does this, but not all versions of vi do.)
Nov
15
comment What are the dangers of creating a normal user with UID < 500?
Debian-derived systems seem to start normal UIDs at 1000, not 500.