home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Steve Franks
I keep reading about making sh scripts executable with #!/bin/sh on the first line and chmod to executable. That works with all my system scripts (rc, etc.) or my system would be DOA, no doubt. When I do it in my home folder, however, running script gives command not found. I've only read about

RE: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Barry Byrne
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Franks Sent: 07 January 2008 15:53 I keep reading about making sh scripts executable with #!/bin/sh on the first line and chmod to executable. That works with all my system scripts (rc,

home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Robert Huff
Steve Franks writes: I keep reading about making sh scripts executable with #!/bin/sh on the first line and chmod to executable. That works with all my system scripts (rc, etc.) or my system would be DOA, no doubt. When I do it in my home folder, however, running script gives command

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Eric Crist
On Jan 7, 2008, at 9:52 AM, Steve Franks wrote: I keep reading about making sh scripts executable with #!/bin/sh on the first line and chmod to executable. That works with all my system scripts (rc, etc.) or my system would be DOA, no doubt. When I do it in my home folder, however, running

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Steve Franks
This is a sort of 'don't shoot yourself in the foot' design. You cannot run a script or binary simply by name if you're cwd is the directory that contains that script or binary. IIRC, you can't cd / usr/bin and run anything in /usr/bin without explicitly calling that file with the ./

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Josh Carroll
I keep reading about making sh scripts executable with #!/bin/sh on the first line and chmod to executable. That works with all my system scripts (rc, etc.) or my system would be DOA, no doubt. When I do it in my home folder, however, running script gives command not found. That typically

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Josh Carroll
How are you running the commands? The problem is probably to do with your path. Your home directory isn't typically and shouldn't be in your PATH (try echo $PATH). You need to specify the full path to your scripts or place a ./ in front of the script name if in the same directory. e.g.

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Jim Bow
Hey Steve, Steve Franks wrote: Ah! You'd think any one of the many tutorials I read would have mentioned that little detail ;) Tutorials do have a tendency to look over important details. That's why I would always recommend a good book, something like UNIX Power Tools in your case, which,

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Erik Osterholm
On Mon, Jan 07, 2008 at 09:13:39AM -0700, Steve Franks wrote: This is a sort of 'don't shoot yourself in the foot' design. You cannot run a script or binary simply by name if you're cwd is the directory that contains that script or binary. IIRC, you can't cd / usr/bin and run anything in

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread James Harrison
On Mon, 2008-01-07 at 10:50 -0600, Erik Osterholm wrote: On Mon, Jan 07, 2008 at 09:13:39AM -0700, Steve Franks wrote: This is a sort of 'don't shoot yourself in the foot' design. You cannot run a script or binary simply by name if you're cwd is the directory that contains that script

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Mike Bristow
On Mon, Jan 07, 2008 at 10:50:47AM -0600, Erik Osterholm wrote: The '.' notation for the current working directory enables you to add the current directory you happen to be in as part of your path (thus making it searched when executing a command), however this has serious security

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Mike Jeays
On January 7, 2008 12:04:39 pm Mike Bristow wrote: On Mon, Jan 07, 2008 at 10:50:47AM -0600, Erik Osterholm wrote: The '.' notation for the current working directory enables you to add the current directory you happen to be in as part of your path (thus making it searched when executing a

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Robert Huff
James Harrison writes: One example that comes to mind is the CUPS port. It installs its own version of the lpr binary in /usr/local/bin. However, there's also an instance of lpr, the BSD version, in /usr/bin. So how do you make sure you're using the CUPS version of the binary? The

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Bill Moran
In response to Mike Jeays [EMAIL PROTECTED]: On January 7, 2008 12:04:39 pm Mike Bristow wrote: On Mon, Jan 07, 2008 at 10:50:47AM -0600, Erik Osterholm wrote: The '.' notation for the current working directory enables you to add the current directory you happen to be in as part of your

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Jonathan Chen
On Mon, Jan 07, 2008 at 01:21:46PM -0500, Robert Huff wrote: James Harrison writes: One example that comes to mind is the CUPS port. It installs its own version of the lpr binary in /usr/local/bin. However, there's also an instance of lpr, the BSD version, in /usr/bin. So how do you