*BSD News Article 58144


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!nntp.coast.net!news.kei.com!news.mathworks.com!fu-berlin.de!zib-berlin.de!news.tu-chemnitz.de!irz401!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Newbie: X-Win mouse support?
Date: 26 Dec 1995 15:04:18 GMT
Organization: Private BSD site, Dresden
Lines: 31
Message-ID: <4bp2ti$8q4@uriah.heep.sax.de>
References: <4bnod4$dav@news.nstn.ca>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.3

miker@fox.nstn.ns.ca (Michael Richard) writes:

> 	Another question to whoever can answer it. Why can't I execute 
> programs the same when I am logged in under root as a user which I made 
> myself? under root I need to type: exec ./prog_name. logged in under my 
> own username I created, I only need to type the name of the executable. 
> This is annoying because I have to login again after the exec is 
> complete. That dumps me back at the home directory!

That's because you forgot to buy a Unix introductionary book.

Root's path should NEVER contain ``.''.  This is a precaution against
Troyan Horses.  Hence leave it as it is.

Read about the functionality of ``exec'' in the man page for sh(1).
It replaces the shell in the current process by the new executable, so
once the latter terminated, you're logged out.  So don't use exec
except as the last command in a shell script.

Simply

	./prog_name

does the trick.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)