I've added a counter (of successful commands in a row) to my bashrc. I've seen it as high as 120. function promptCommand() { LAST_STATUS=$? # Set title of window to dir, then add new line to prompt. PS1='\[\e]0;\w\a\]\n' if [ $LAST_STATUS -eq 0 ]; then ((successes++)) PS1+='\[\033[1;32m\][$successes]' else successes=0 PS1+='\[\033[1;31m\][0 $LAST_STATUS]' fi PS1+='\[\033[0;32m\] ' PS1+='\w $(date +%H:%M) \$ \[\033[0m…
Man, I hope you don't use grep very often (by default it uses exit code 1 when it doesn't find anything).
Suicide Linux
91–100 of 135 posts
Re: Suicide Linux
#92Re: Suicide Linux
#93> The reaction from the OS is actually rather underwhelming. Somehow related, a coworker at a previous place unmounted some disks on an old AIX production box. It took him a solid minute to realise he had mistakenly unmounted / due to a typo (yes it was possible) as old processes with already opened files were happily serving stuff and only new attempts at opening files were beginning to produce errors. Also, a simil…
Luckily I was able to recover its contents, while hoping not to lose the network connection during the process.
Re: Suicide Linux
#94> You know how sometimes if you mistype a filename in Bash, it corrects your spelling and runs the command anyway? What? No, what's that about?
Yeah, I'm not aware of any distro that has this setting enabled by default. It's neat that it exists, though.
Re: Suicide Linux
#95On Illumos rm -rf / does nothing. POSIX says that removing / has undefined behavior, so the obviously smart (useful, user-friendly, GOOD) thing to do is to do nothing, as that fits "undefined behavior".
That's quite funny... but ultimately futile. It doesn't say what happens if you say "DROP TABLE xyz WHERE...ohshit". (The bit is because you're used to doing that in your preferred SQL-DB editor.) One should NEVER do anything non-scripted on a production system. ALWAYS enter it into a file and then do the "run-sql-from-a-file" command. EDIT: Yes, I also realize that "rm -rf /" can theoretically happen if you have a b…
Re: Suicide Linux
#96Earlier quoted context omitted.
Tip: If you ever trigger sl by mistake, and you're in a hurry, press Ctrl+Z instead of Ctrl+C (which doesn't work).
That seems like a bug in sl: it should signal(SIGTSTP, SIG_IGN) (or put the terminal in raw mode, better yet)
Re: Suicide Linux
#97This reminds me of Vigil, "the eternal morally vigilant programming language" https://github.com/munificent/vigil
Re: Suicide Linux
#98Earlier quoted context omitted.
If it didn't exist in the first place, then you had no business searching for it. You should have just known not to look. :)
Negative result is still a result. I sometimes use `grep -r` to check whether "does this set of files contain this particular string?" and "no" is a useful answer :)
Re: Suicide Linux
#99It would be nice for someone to develop a suicide-g++. Whenever you compile a program that results in Undefined Behavior, the execution of it will wipe your disk.
Re: Suicide Linux
#100Earlier quoted context omitted.
Man, I hope you don't use grep very often (by default it uses exit code 1 when it doesn't find anything).
If it didn't exist in the first place, then you had no business searching for it. You should have just known not to look. :)
In the former, if a result can't be found it will return `nil` but in the latter it expects the record to exist and so will raise an exception if it can't be found.