After countless hours of editing and fixing bugs in your C programs, you're finally ready to go home. It's past midnight. You're tired, but happy to be delivering your project on time. It was a close call, but you made it.

Of course, let's clean the old .o files and do a final make, just to make sure the Makefile is fine:

/usr/project/src$ rm * .o
/usr/project/src$ rm: cannot remove `.o': No such file or directory
/usr/project/src$ ls -l
total 0
Arrrrrrggggghhhhhh!!!.... An agonizing scream is heard in the night...

Note to non-Unix readers

If you don't know Unix, note that there's a space in the command "rm * .o", which should be "rm *.o" to remove all the object files in the current directory. With the space, the command will delete EVERYTHING (including your beloved C source code) and then try to erase a file named .o that does not exist. This is a very common mistake that people tend to do when they're very tired.

Or, as has happened many times to me: you get groggy and such, and you are careless with your compiler setups:

jbonci@reno programs> rm *.o
jbonci@reno programs> rm *.out
jbonci@reno programs> gcc myprog.c -o myprog.c
jbonci@reno programs> a.out
bash: a.out: command not found

jbonci@reno programs> cat myprog.c
Garbled junk here

*Insert horrified scream here* I can think of three classes where that got me.

Keep in mind young Jedi, you are not a keyboard monkey!

Note: Do not try the above. You will compile over your old code!
Another fun case. Y'all know joe and its compatriots, jed and jmacs. It makes backups of files as filename~. After an intense editing session, your directories become littered with ~ files, which serve no purpose, and can be real pains (especially if they let people view the source of files that they shouldn't, which is a distinct possibility on a web server, where index.php~ is not the same as index.php - the former lets people view source, whereas the latter is safely executed.) To combat this, I normally do:
s_alanet@codemonkey:/home/httpd/html/$ rm -f *~
Which will go and delete all the ~ files created by joe without making me confirm each one. However, it has the capacity to misfire horribly:
s_alanet@codemonkey:/home/httpd/html/$ rm -f *
You'll note the missing ~ there. That's right - that says to delete all the files in the current directory, without asking. Whups...

Luckily, I managed to recover the files I deleted - a good thing, too, as I had put quite a few dozen hours of work into them, and my boss wanted them up on the web in a day or two.

Log in or register to write something here or to contact authors.