Results 1 to 2 of 2

Thread: Nautilus "run in terminal" fails

  1. #1
    Join Date
    Mar 2005
    Location
    Buenos Aires, Argentina
    Beans
    73
    Distro
    Ubuntu 11.04 Natty Narwhal

    [SOLVED] Nautilus "run in terminal" fails

    Hi friends. Under Ubuntu 8.10 and before that, clicking on a file marked as executable (e.g., a perl script) made Nautilus offer 4 options: run file in terminal, open, cancel, run.

    After upgrading to Ubuntu 9.04, Nautilus offers those 4 options, but when the first one is chosen (run in terminal) a quick flash of a terminal appears and disappears without running the script.

    An error message appears very quickly in the terminal: "file not found /usr/bin/perl". I think this is related to the first line of any perl script, known as shebang: #!/usr/bin/perl.

    Of course what the error message states is not true: /usr/bin/perl does exist.

    The same script works OK when launched from the terminal (i.e., not using Nautilus).

    Has anyone experienced trouble executing a script through popup menus in Nautilus?
    Last edited by etitor; May 10th, 2009 at 05:54 PM. Reason: Found solution myself !

  2. #2
    Join Date
    Mar 2005
    Location
    Buenos Aires, Argentina
    Beans
    73
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: [SOLVED] Nautilus "run in terminal" fails

    Quote Originally Posted by etitor View Post
    Hi friends. Under Ubuntu 8.10 and before that, clicking on a file marked as executable (e.g., a perl script) made Nautilus offer 4 options: run file in terminal, open, cancel, run.

    After upgrading to Ubuntu 9.04, Nautilus offers those 4 options, but when the first one is chosen (run in terminal) a quick flash of a terminal appears and disappears without running the script.

    An error message appears very quickly in the terminal: "file not found /usr/bin/perl". I think this is related to the first line of any perl script, known as shebang: #!/usr/bin/perl.

    Of course what the error message states is not true: /usr/bin/perl does exist.

    The same script works OK when launched from the terminal (i.e., not using Nautilus).

    Has anyone experienced trouble executing a script through popup menus in Nautilus?
    I solved this out by myself and thought it would be useful to share.

    Just be sure no BOM (byte order mark) exists at the very beginning of your script's file. The BOM is added by some text editors, notably Geany, but prevents the script from being run from Nautilus since the BOM interferes with the shebang line.
    Last edited by etitor; May 10th, 2009 at 08:16 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •