FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 02-06-2010, 02:03 PM
Patrick O'Callaghan
 
Default Stoopid script failure

Can anyone explain why this doesn't work? I've been writing shell
scripts on and off for several decades and I can't see what's going on
here. Is senility setting it?

$ cat > tst
#!/bin/sh
echo foo
$ chmod +x tst
$ ls -l tst
-rwxrwxr-x 1 poc poc 19 2010-02-06 10:22 tst
$ type tst
tst is ./tst
$ tst
bash: ./tst: Permission denied

(SElinux is off, if it matters).

poc

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
 
Old 02-06-2010, 02:14 PM
Waleed Harbi
 
Default Stoopid script failure

Try:
#./tst

#file tst
tst: Bourne shell script text executable

--------------------------
Best Wishes,
Waleed Harbi



Dream | Do | Be



On Sat, Feb 6, 2010 at 6:03 PM, Patrick O'Callaghan <pocallaghan@gmail.com> wrote:


Can anyone explain why this doesn't work? I've been writing shell

scripts on and off for several decades and I can't see what's going on

here. Is senility setting it?



$ cat > tst

#!/bin/sh

echo foo

$ chmod +x tst

$ ls -l tst

-rwxrwxr-x 1 poc poc 19 2010-02-06 10:22 tst

$ type tst

tst is ./tst

$ tst

bash: ./tst: Permission denied



(SElinux is off, if it matters).



poc



--

users mailing list

users@lists.fedoraproject.org

To unsubscribe or change subscription options:

https://admin.fedoraproject.org/mailman/listinfo/users

Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines



--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
 
Old 02-06-2010, 02:24 PM
Ed Greshko
 
Default Stoopid script failure

Patrick O'Callaghan wrote:
> Can anyone explain why this doesn't work? I've been writing shell
> scripts on and off for several decades and I can't see what's going on
> here. Is senility setting it?
>
> $ cat > tst
> #!/bin/sh
> echo foo
> $ chmod +x tst
> $ ls -l tst
> -rwxrwxr-x 1 poc poc 19 2010-02-06 10:22 tst
> $ type tst
> tst is ./tst
> $ tst
> bash: ./tst: Permission denied
>
> (SElinux is off, if it matters).
>
>
I'm fairly sure you need the ./tst incantation unless you have . in your
$PATH. I recall somewhere, sometime a warning against that....but I've
ignored it for years and haven't had a problem. I even forgot what the
warning was all about.


--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
 
Old 02-06-2010, 02:25 PM
inode0
 
Default Stoopid script failure

On Sat, Feb 6, 2010 at 9:03 AM, Patrick O'Callaghan
<pocallaghan@gmail.com> wrote:
> Can anyone explain why this doesn't work? I've been writing shell
> scripts on and off for several decades and I can't see what's going on
> here. Is senility setting it?
>
> $ cat > tst
> #!/bin/sh
> echo foo
> $ chmod +x tst
> $ ls -l tst
> -rwxrwxr-x 1 poc poc 19 2010-02-06 10:22 tst
> $ type tst
> tst is ./tst
> $ tst
> bash: ./tst: Permission denied
>
> (SElinux is off, if it matters).

Any chance the filesystem is mounted with noexec?

John
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
 
Old 02-06-2010, 02:26 PM
Todd Zullinger
 
Default Stoopid script failure

Patrick O'Callaghan wrote:
> Can anyone explain why this doesn't work? I've been writing shell
> scripts on and off for several decades and I can't see what's going on
> here. Is senility setting it?

It may be, but it brings with it many benefits -- like being able to
eat dessert twice because you "forgot" you'd had cake already.

> $ tst
> bash: ./tst: Permission denied

'.' is not in $PATH (by default and for good reason), so you must
specify ./tst to run the script.

--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
I am not young enough to know everything.
-- Oscar Wilde (1854-1900)

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
 
Old 02-06-2010, 02:34 PM
Ed Greshko
 
Default Stoopid script failure

Ed Greshko wrote:
> Patrick O'Callaghan wrote:
>
>> Can anyone explain why this doesn't work? I've been writing shell
>> scripts on and off for several decades and I can't see what's going on
>> here. Is senility setting it?
>>
>> $ cat > tst
>> #!/bin/sh
>> echo foo
>> $ chmod +x tst
>> $ ls -l tst
>> -rwxrwxr-x 1 poc poc 19 2010-02-06 10:22 tst
>> $ type tst
>> tst is ./tst
>> $ tst
>> bash: ./tst: Permission denied
>>
>> (SElinux is off, if it matters).
>>
>>
>>
> I'm fairly sure you need the ./tst incantation unless you have . in your
> $PATH. I recall somewhere, sometime a warning against that....but I've
> ignored it for years and haven't had a problem. I even forgot what the
> warning was all about.
>
>
I retract that last paragraph as rubbish...as I misread "permission
denied"...

--
Mix a little foolishness with your serious plans; it's lovely to be
silly at the right moment. -- Horace

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
 
Old 02-06-2010, 02:41 PM
Ed Greshko
 
Default Stoopid script failure

Todd Zullinger wrote:
> Patrick O'Callaghan wrote:
>
>> Can anyone explain why this doesn't work? I've been writing shell
>> scripts on and off for several decades and I can't see what's going on
>> here. Is senility setting it?
>>
>
> It may be, but it brings with it many benefits -- like being able to
> eat dessert twice because you "forgot" you'd had cake already.
>
>
>> $ tst
>> bash: ./tst: Permission denied
>>
>
> '.' is not in $PATH (by default and for good reason), so you must
> specify ./tst to run the script.
>
>
I did retract what I had said earlier...and tested on my system here....

If '.' is not in my PATH I get...

[egreshko@f12 x]$ type tst
-bash: type: tst: not found

Added to the end of my PATH results in ....

[egreshko@f12 x]$ type tst
tst is ./tst

[egreshko@f12 x]$ tst
foo





--
Will the third world war keep ``Bosom Buddies' off the air?

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
 
Old 02-06-2010, 02:42 PM
Patrick O'Callaghan
 
Default Stoopid script failure

On Sat, 2010-02-06 at 10:26 -0500, Todd Zullinger wrote:
> Patrick O'Callaghan wrote:
> > Can anyone explain why this doesn't work? I've been writing shell
> > scripts on and off for several decades and I can't see what's going on
> > here. Is senility setting it?
>
> It may be, but it brings with it many benefits -- like being able to
> eat dessert twice because you "forgot" you'd had cake already.
>
> > $ tst
> > bash: ./tst: Permission denied
>
> '.' is not in $PATH (by default and for good reason), so you must
> specify ./tst to run the script.

I know . isn't in $PATH by default. I added it to $PATH before doing
this, as evidenced by the "type tst" line in my post.

Furthermore, I also get:

$ ./tst
bash: ./tst: Permission denied
$

poc

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
 
Old 02-06-2010, 02:44 PM
Patrick O'Callaghan
 
Default Stoopid script failure

On Sat, 2010-02-06 at 09:25 -0600, inode0 wrote:
> On Sat, Feb 6, 2010 at 9:03 AM, Patrick O'Callaghan
> <pocallaghan@gmail.com> wrote:
> > Can anyone explain why this doesn't work? I've been writing shell
> > scripts on and off for several decades and I can't see what's going on
> > here. Is senility setting it?
> >
> > $ cat > tst
> > #!/bin/sh
> > echo foo
> > $ chmod +x tst
> > $ ls -l tst
> > -rwxrwxr-x 1 poc poc 19 2010-02-06 10:22 tst
> > $ type tst
> > tst is ./tst
> > $ tst
> > bash: ./tst: Permission denied
> >
> > (SElinux is off, if it matters).
>
> Any chance the filesystem is mounted with noexec?

That's exactly it! Thanks, I was starting to worry about my sanity.

poc


--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
 
Old 02-06-2010, 02:50 PM
Paolo Galtieri
 
Default Stoopid script failure

On 02/06/2010 08:34 AM, Ed Greshko wrote:
> Ed Greshko wrote:
>
>> Patrick O'Callaghan wrote:
>>
>>
>>> Can anyone explain why this doesn't work? I've been writing shell
>>> scripts on and off for several decades and I can't see what's going on
>>> here. Is senility setting it?
>>>
>>> $ cat> tst
>>> #!/bin/sh
>>> echo foo
>>> $ chmod +x tst
>>> $ ls -l tst
>>> -rwxrwxr-x 1 poc poc 19 2010-02-06 10:22 tst
>>> $ type tst
>>> tst is ./tst
>>> $ tst
>>> bash: ./tst: Permission denied
>>>
>>> (SElinux is off, if it matters).
>>>
>>>
>>>
>>>
>> I'm fairly sure you need the ./tst incantation unless you have . in your
>> $PATH. I recall somewhere, sometime a warning against that....but I've
>> ignored it for years and haven't had a problem. I even forgot what the
>> warning was all about.
>>
>>
>>
> I retract that last paragraph as rubbish...as I misread "permission
> denied"...
>
>
check to see what shell /bin/sh actually refers to. Usually /bin/sh is
a link to /bin/bash but it doesn't have to be. You can also try to run

/bin/bash -x tst

and see what happens.

Paolo
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
 

Thread Tools




All times are GMT. The time now is 06:48 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org