bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cd || disaster; set +n: possible after set -n?


From: Dan Jacobson
Subject: cd || disaster; set +n: possible after set -n?
Date: 01 Dec 2001 21:00:57 +0800
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

You know what bugs me: that things just keep rolling on even though we
blew a cd command: 

$ cat l
cd /ffff
echo rm everything
pwd
$ bash l
l: cd: /ffff: No such file or directory
rm everything
/tmp

yes, I could do

$ bash -e l
l: cd: /ffff: No such file or directory

and naturally cd /ffff || { echo sorry >&2; exit 4;}

and I'm sure "it's in the specs" that cd does these bad things, but I
can't think of too many situations where on just "cd's around" and
well, it just like oops I got my girlfriends' address wrong, must be
on a different street somewhere, but no big deal, I just go in anyway
like robocop-boyfriend and "get busy" just the same...

By the way, what kind of logpile, road block, police barricade, do I
need to derail bash -n when reading a shell script?  My measly "exit;
exit; exit" of course I'm sure are according to the specs, are just
not strong enough.

By the way,
$ set -n
$ set +n
$ set
$
is it true that once in -n "neuter" mode there's just no way to,
sniff, get it back out?

wait, a nifto maneuver:
$ set +n
$ ^D Use "exit" to leave the shell.
$  exit
$ ^D Use "exit" to leave the shell.
$ ^D Use "exit" to leave the shell.
$ ^D Use "exit" to leave the shell.
$ ^D Use "exit" to leave the shell.
$ ^D Use "exit" to leave the shell.
$ ^D Use "exit" to leave the shell.
$ ^D Use "exit" to leave the shell.
$ ^D Use "exit" to leave the shell.
$ ^D Use "exit" to leave the shell.
$ ^D Use "exit" to leave the shell.
$ ^D exit

Process shell exited abnormally with code 2

[Again, I'm sure nothing not in the rule book here, but it's just interesting.]
-- 
http://www.geocities.com/jidanni/ Tel+886-4-25854780



reply via email to

[Prev in Thread] Current Thread [Next in Thread]