4,234 reputation
11222
bio website keith-s-thompson.github.com
location San Diego, CA
age 54
visits member for 2 years, 7 months
seen yesterday

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

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


Jan
18
revised sh script will not execute as root (cron)
Formatting
Jan
18
comment sh script will not execute as root (cron)
You wrote cronjob -l. There is no cronjob command. Did you mean crontab -l? The #!/bin/bash at the top of your script is correct, but then the correct way to invoke it is just /root/miami.sh, not /bin/sh /root/miami.sh; you should remove the /bin/sh from your cron job. Is the stuff in your question after the incorrect cronjob line the output of crontab -l? Did you run crontab -l as the root user? You refer to both thescriptname.sh and miami.sh; if those refer to the same thing, please update your question to be more consistent.
Jan
18
comment sh script will not execute as root (cron)
What is cronjob -e? What is the output of crontab -l executed as root? Why does a bash script have a .sh suffix, and why are you executing it with /bin/sh rather than running it directly? You're using some bash-specific features that /bin/sh may or may not support, but there's not enough information to know whether that's the problem.
Jan
18
revised sh script will not execute as root (cron)
Formatting
Jan
18
comment sh script will not execute as root (cron)
Also posted here on Stack Overflow.
Jan
18
comment How to restrict rm -rf / in CentOS machine?
Not running as root should prevent most of the harm that rm -rf / would otherwise do.
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.