Thursday, May 24, 2007

warning: sick lady feeling good and returning to nerd roots

Today I learned that coyotes get heartworms, that some cell phones will kill your fancy electronic Nissan car keys, and that if someone expects you to do badly at something, you will not let them down, which as a female physicist, I noticed. I just assumed it was a character defect... because I was probably defective. (It turns out I was just getting sick.) We also got the quote of the day from a guy who admits he dances like a tiptoeing rhinoceros:
Once you've fainted waiting in line to give blood, the rest of your life is pretty much all downhill on the embarrassment front.
So then I learned to write a shell script, and I am fully confident that at least three of you are right now thinking, "She's never written a shell script before?" To which I can only reply that I've had bosses and jobs where everybody relied solely on DOS and QuickBasic, and later, Windows and Matlab, so I was, indeed, crippled until today. Well, not entirely, because Matlab is pretty handy.

Anyway, today I learned that 'kill' and 'killall' are really just for telling programs 'hey.' killall works on anything with the same process name, but kill is good for individual processes.
  • Cntrl-Z = kill -STOP [process number collected from grep]
  • Cntrl-C = kill -INT [process number collected from grep], and -INT (short for interrupt) stands for -2; -l gives a list
  • kill -9 = kill -KILL = die
-STOP and -KILL don't talk to the program; they are no questions asked. Other signals can be handled by a signal handler in the program, so when you kill your computer-controlled irrigation system, you can have it close the valves instead of leaving them open, as a kill -9 would do.

Other key bits of information:
  • '.' means here, so if you want to run your shell script, the path is ./ in front of the name.
  • When you want to use all the variables you read in from the command line, conveniently named 1, 2, 3, etc., you call them $1, $2, etc.
  • exit means exit 0, so the program exited normally, but exit 1 means exit and false, so you know something screwy happened.
$ echo=echo
$ echo $echo
echo
$

1 Comments:

Anonymous buy erectile dysfunction medication online said...

Thank you for providing such a valuable information and thanks for sharing this matter.

7:20 PM  

Post a Comment

<< Home