Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!esosun!cogen!alen From: alen@cogen.UUCP (Alen Shapiro) Newsgroups: comp.unix.questions Subject: Re: Trick question Message-ID: <380@cogen.UUCP> Date: Mon, 19-Oct-87 15:21:34 EDT Article-I.D.: cogen.380 Posted: Mon Oct 19 15:21:34 1987 Date-Received: Tue, 20-Oct-87 23:49:47 EDT References: <666@portofix.liu.se> Reply-To: alen@cogen.UUCP (Alen Shapiro) Organization: Cogensys, LaJolla, Calf. Lines: 44 Keywords: path PATH which Summary: you have another '+' command In article <666@portofix.liu.se> kjepo@portofix.liu.se (Kjell Post) writes: >A little trick question for you all: what's happening here? > > % cat > \* > date > ^D > % chmod +x \* > % \* > Tue Oct 13 03:13:08 MET 1987 > % > % cat > + > date > ^D > % chmod +x + > % + > $ -- entered Bourne-shell > You have another '+' command, some sites use this command to give single command su status, but used by itself it gives you a root shell (if you pass the site dependent '+' id test). Try % which + to see where it is kept also % ./+ to resolve the conflict A related effect; A good way to spend a day debugging a working program is to call the test version of a program "test", since most sites have a /bin/test and the user usually has '.' last on his path list (can you say security), when you invoke the program (% test) /bin/test gets run not ./test and NOTHING will be printed. Using a debugger (dbx etc.) the program works fine but once back at command level it fails again. The answer of course is to assume the debugger is not worth a sh** and put print statements in the program, progressivly nearer to main() till some response is obtained. Since /bin/test is running, no response will ever be seen and the programmer will go quietly insane. (By the way, old versions of the test program ("o_test" etc.) magically start to work if they are tried!!). --alen the Lisa slayer (it's a long story) ...!seismo!esosun!cogen!alen