Bug 158617 - Nautilus fails to open shell script files
Summary: Nautilus fails to open shell script files
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: nautilus   
(Show other bugs)
Version: 4
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Alexander Larsson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-05-24 04:37 UTC by Ian Puleston
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-09-04 14:52:07 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Ian Puleston 2005-05-24 04:37:10 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050308 Firefox/1.0.1 Fedora/1.0.1-5

Description of problem:
I'm trying to have a shell script executed by double-clicking the file icon in GNOME's Nautilus file browser. I have the following simple shell script named tst.sh and with "+x" attributes:

#!/bin/sh -f
echo Hello there
read -p "Hit return: " tmpvar

The default action for this file under Nautilus is "Open with Terminal", but when I double-click it or select "Open with Terminal" from its menu I just get a spinning hourglass for 30 seconds or so. If I then return to the main console screen (Ctrl-Alt-F1) I see the following warning was reported:

   Invalid argument: "/home/ian/tst.sh"

If I right-click the file and select Open with EMACS that works OK. After a little bit of playing with it I've discovered:

1. If the file has a ".sh" extension or begins with the line "#!/bin/sh -f" then Nautilus recognizes it as a shell script and changes the icon to 3 cog wheels. Then if I double-click it I just get the hourglass.

2. If I rename the file to remove the ".sh" extension and delete that first line, then the icon changes to the one for a plain text file. Then if I double-click it I get the "run or display?" dialog, and if I select Run in Terminal it works OK.


Version-Release number of selected component (if applicable):
2.10.0-4

How reproducible:
Always

Steps to Reproduce:
1. Create an executable shell script file beginning with the line "#!/bin/sh -f" and/or with a .sh extension.
2. Browse to the file in Nautilus and verify that in its properties the default under "Open With" is Terminal.
3. Double-click the file, or right-click it and select Open with Terminal.

  

Actual Results:  The file does not execute. A spinning hourglass is shown for 30 seconds or so.

Expected Results:  It should be executed under a terminal window.

Additional info:

Comment 1 Alexander Larsson 2006-09-04 14:52:07 UTC
I created the test.sh you describe, and things work for me in rawhide/FC6.



Note You need to log in before you can comment on or make changes to this bug.