On Sat, Nov 04, 2006 at 06:11:03PM -0600, Brian van den Broek wrote: > Hi all, > > I'm still getting comfortable with Linux and this might be an OS > rather than a python problem. > > I am trying to make a script directly executable. I've reviewed the > 2nd ed of the Nutshell, and I cannot work out what I'm doing wrong. > I'm running ubunutu 6.10 (edgy eft). Here's a copy past of my command > line: > > [EMAIL PROTECTED]:~/test$ which python > /usr/bin/python > [EMAIL PROTECTED]:~/test$ ls -la shebangtest.py > -rwxr-xr-- 1 brian brian 68 2006-11-04 02:29 shebangtest.py > [EMAIL PROTECTED]:~/test$ cat shebangtest.py > #!/usr/bin/python > > if __name__ == '__main__': > > print "It works" > [EMAIL PROTECTED]:~/test$ shebangtest > bash: shebangtest: command not found > [EMAIL PROTECTED]:~/test$ shebangtest.py > bash: shebangtest.py: command not found
Most likely the current directory is not in your path. Type in 'echo $PATH' and look for a single period between colons. It is correct *not* to have the current directory in your path for security reasons. Now type in: './shebangtest' and your program should run. Putting the './' in front tells bash to use the command in the current directory. -- "Rousseau was convinced that God, nature and man were wrong. I know that this opinion still sways many minds, but mine is not one of them." -- Frédéric Bastiat (1801-1850) Rick Pasotto [EMAIL PROTECTED] http://www.niof.net _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor