vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| All the docs say that Nautilus scripts can be written in any scripting language, but this does not appear to be true - I think there is a list of allowed languages. If the first line of my script is #!/bin/bash then nautilus identifies it as a shell script; if the first line is #!/usr/bin/python then it's identified as a python script; but if the first line is #!/usr/bin/rexx then nautilus ignores it. Is there an editable list of valid programs? |
| |||
| On 2008-02-05, Bob Martin <bob.martin@excite.com> wrote: > > > > All the docs say that Nautilus scripts can be written in any scripting > language, but this does not appear to be true - I think there is a > list of allowed languages. > > If the first line of my script is #!/bin/bash then nautilus identifies > it as a shell script; if the first line is #!/usr/bin/python then it's > identified as a python script; but if the first line is > #!/usr/bin/rexx then nautilus ignores it. > > Is there an editable list of valid programs? Is there a difference between a nautilus script and a script run from a shell prompt? Normally the kernel reads the #! line, and any interpreter should be allowed if it and the script have execute permission. What happens if you try to run a script with #!/usr/bin/rexx? |
| |||
| in 448685 20080205 135947 Bill Marcum <marcumbill@bellsouth.net> wrote: >On 2008-02-05, Bob Martin <bob.martin@excite.com> wrote: >> >> >> >> All the docs say that Nautilus scripts can be written in any scripting >> language, but this does not appear to be true - I think there is a >> list of allowed languages. >> >> If the first line of my script is #!/bin/bash then nautilus identifies >> it as a shell script; if the first line is #!/usr/bin/python then it's >> identified as a python script; but if the first line is >> #!/usr/bin/rexx then nautilus ignores it. >> >> Is there an editable list of valid programs? > >Is there a difference between a nautilus script and a script run from a >shell prompt? >Normally the kernel reads the #! line, and any interpreter should be >allowed if it and the script have execute permission. What happens if >you try to run a script with #!/usr/bin/rexx? They work fine, I have hundreds of Rexx programs. Nautilus is obviously reading the first line and deciding it doesn't like it. |
| |||
| Bob Martin <bob.mar...@excite.com> wrote: > > All the docs say that Nautilus scripts can be written in any scripting language, > but this does not appear to be true - I think there is a list of allowed languages. > > If the first line of my script is #!/bin/bash then nautilus identifies it as a shell script; > if the first line is #!/usr/bin/python then it's identified as a python script; but if > the first line is #!/usr/bin/rexx then nautilus ignores it. > > Is there an editable list of valid programs? If I were writing a program like Nautilus I'd use "file" to identify files by type. Actually, I'd probably crib the underlying code from "file" using the same config file and such. Do a man on "file" and you can peruse the config file probably used. |
| |||
| Doug writes: > If I were writing a program like Nautilus I'd use "file" to identify > files by type. Actually, I'd probably crib the underlying code from > "file" using the same config file and such. Much better to use libmagic1 as "file" does, and as Nautilus evidently does not. -- John Hasler john@dhh.gt.org Dancing Horse Hill Elmwood, WI USA |
| |||
| in 448693 20080205 200534 Doug Freyburger <dfreybur@yahoo.com> wrote: >Bob Martin <bob.mar...@excite.com> wrote: >> >> All the docs say that Nautilus scripts can be written in any scripting language, >> but this does not appear to be true - I think there is a list of allowed languages. >> >> If the first line of my script is #!/bin/bash then nautilus identifies it as a shell script; >> if the first line is #!/usr/bin/python then it's identified as a python script; but if >> the first line is #!/usr/bin/rexx then nautilus ignores it. >> >> Is there an editable list of valid programs? > >If I were writing a program like Nautilus I'd use "file" to identify >files by type. Actually, I'd probably crib the underlying code >from "file" using the same config file and such. Do a man on >"file" and you can peruse the config file probably used. "man file" says that the language test is performed using names.h but the only file I can find with this name is empty. |
| |||
| Bob Martin writes: > "man file" says that the language test is performed using names.h but the > only file I can find with this name is empty. Go back and read the man page again. "names.h" is an example of one of the strings it looks for, not the name of file it uses. Here is the list of files "file" uses, from the man page: FILES /usr/share/file/magic.mgc Default compiled list of magic numbers /usr/share/file/magic Default list of magic numbers /usr/share/file/magic.mime.mgc Default compiled list of magic numbers, used to output mime types when the -i option is specified. /usr/share/file/magic.mime Default list of magic numbers, used to output mime types when the -i option is specified. -- John Hasler john@dhh.gt.org Dancing Horse Hill Elmwood, WI USA |
| |||
| in 448711 20080206 132328 John Hasler <john@dhh.gt.org> wrote: >Bob Martin writes: >> "man file" says that the language test is performed using names.h but the >> only file I can find with this name is empty. > >Go back and read the man page again. "names.h" is an example of one of the >strings it looks for, not the name of file it uses. > >Here is the list of files "file" uses, from the man page: > >FILES >/usr/share/file/magic.mgc Default compiled list of magic numbers >/usr/share/file/magic Default list of magic numbers >/usr/share/file/magic.mime.mgc Default compiled list of magic numbers, used to output mime types when the >-i option is specified. >/usr/share/file/magic.mime Default list of magic numbers, used to output mime types when the -i option >is specified. OK, but what is the relevance to my nautilus problem? Rexx programs work fine from the command line but not as nautilus scripts. |
| |||
| Bob Martin <bob.martin@excite.com> wrote: > All the docs say that Nautilus scripts can be written in any scripting language, > but this does not appear to be true - I think there is a list of allowed languages. > > If the first line of my script is #!/bin/bash then nautilus identifies it as a shell script; > if the first line is #!/usr/bin/python then it's identified as a python script; but if > the first line is #!/usr/bin/rexx then nautilus ignores it. > > Is there an editable list of valid programs? I guess nautilus uses the file's MIME type. See http://www.freedesktop.org/wiki/Stan...mime-info-spec for how to add your own MIME types. Florian -- <http://www.florian-diesch.de/> ----------------------------------------------------------------------- ** Hi! I'm a signature virus! Copy me into your signature, please! ** ----------------------------------------------------------------------- |
| ||||
| Bob Martin writes: > OK, but what is the relevance to my nautilus problem? Rexx programs work > fine from the command line but not as nautilus scripts. Nautilus evidently not only does not use libmagic, it doesn't even use the magic files. This is a bug. -- John Hasler john@dhh.gt.org Dancing Horse Hill Elmwood, WI USA |