News for hackers. Stuff that matters.
Re:Suicide Linux (2011) by callesgg on Sunday April 19, 2015 @02:22AM (#9402216)
A common issue, is stuff like:

cd $TempDIR

wget http://example.com #Do stuf in temp dir

rm -R . #Clean Tempdit

if $TempDIR is not set, it will delete your home directory.

If $TempDIR does not exist or the cd somehow fails it will delete your current folder.

Re:Suicide Linux (2011) by alkonaut on Sunday April 19, 2015 @05:09AM (#9402503)
It's just a huge design mistake to treat "missing" like an empty string in env vars. In many cases referencing a missing var should be an error, not a silent conversion to an empty string.

It's funny how many of us would never use a weakly/stringly typed language to handle our important data, but then we happily use bash to deploy or manage the systems on which our apps run.

Re:Suicide Linux (2011) by stinos on Sunday April 19, 2015 @03:01AM (#9402286)
And if #Do stuf in temp dir happens to be one of those mosters which change working dir you could be anywhere. Having the directory shown in your prompt solves most of that though