xdg-utils is a package which developers use to identify file types. It
currently identifies Rexx files by means of the "/*" comment string in
the first line of Rexx programs which are run under OS/2 (and other
OSs?). I've opened a bug requesting that the Regina shebang,
#!/usr/bin/regina, be added to the xdg's mime database:
https://bugs.freedesktop.org/show_bug.cgi?id=9310
If there are any other Rexx shebangs in circulation, please add them
there or let me know and I will.
This issue came to my attention when I noticed that gedit (the Gnome
editor), which now includes syntax highlighting for Rexx, only
automatically switched it on for older Rexx files I had written under
OS/2, not for ones I had written or converted for use under Linux.
Wondering about this behavior, I asked on the gedit mailing list and
was pointed towards xdg.
--
Colin Brace
Amsterdam
The Open Object REXX, BRexx and Rexx/imc interpreters are called
"rexx"; the uni-REXX interpreter is called "rxx" (I think) and Regina
has two executables called "regina" and "rexx".
Ian Collier in the REXX Symposium in 1999 proposed the following
first line for portable Rexx scripts (OS/2, UNIX, mainframes):
/*bin/true;exec rexx "$0" "$@";exit # REXX */
It works fine, you only "need" to change the name and/or the
permisions of the script:
ppwizard.cmd: OS/2
ppwizard.rexx: Windows (Regina)
ppwizard.rex: Windows (Open Object REXX)
ppwizard: Linux
and then call the script:
C:\home> ppwizard /* In Windows, the extension must be in the EXTPATH
environment variable */
Best regards:
Salvador Parra Camacho
Back in March, 2004 I brought this topic up in this ng.
Ian Collier replied in the thread:
From: i...@comlab.ox.ac.uk (Ian Collier)
Newsgroups: comp.lang.rexx
Subject: Re: REXX scripts on _both_ OS/2 and linux
Probably Allodoxaphobia typed into a real computer:
>I am slowly migrating from OS/2 to linux (presently MDK 9.1).
[snip]
>It's going "well" -- so far - this time - this distro.
>But, one thing nags me:
>Does anyone have any thoughts on how to have the _same_ REXX
>script source run on both machines? I am speaking, of course,
>about the "/* REXX */", and the "shebang" constructs.
You can get the Linux kernel to recognise your /* REXX */ comment using
the "binfmt_misc" feature, provided it's enabled in the kernel (and it
usually is for version 2.2.x or higher, though it might be supplied as a
module for which you have to "modprobe binfmt_misc" first).
Just execute the following (you might want to put it in an init script
so that it happens at boot time):
modprobe binfmt_misc
echo ':rexx:M:0:/*::/usr/bin/rexx:' >> /proc/sys/fs/binfmt_misc/register
This means any program starting with a Rexx comment will be executed
by /usr/bin/rexx (obviously you have to change that bit if your Rexx
interpreter is called something else). The program has to have execute
permission set, of course.
----------------------
See the whole thread:
http://groups.google.com/groups
?as_q=linux+shebang&as_ugroup=comp.lang.rexx&as_uauthors=allodoxaphobia
Jonesy
--
Marvin L Jones | jonz | W3DHJ | linux
38.24N 104.55W | @ config.com | Jonesy | OS/2
*** Killfiling google posts: <http//jonz.net/ng.htm>
>If there are any other Rexx shebangs in circulation, please add them
>there or let me know and I will.
Don't forget the Open source Object REXX. I don't know the file name.
--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spam...@library.lspace.org
> Ian Collier in the REXX Symposium in 1999 proposed the following
> first line for portable Rexx scripts (OS/2, UNIX, mainframes):
>
> /*bin/true;exec rexx "$0" "$@";exit # REXX */
I've just noticed that unfortunately this does not work on BSD; perhaps
because rexx is in a different location:
$ which rexx
/usr/local/bin/rexx
This is the error reported:
/home/colin/bin/scanmail.rex: line 1: /*bin/true: No such file or
directory
(I was trying to run one of my Rexx scripts under FreeBSD 6.1 with
ooRexx v.3.0.0 installed)
What a pity...
--
Colin Brace
Amsterdam
No, it's because "true" is in a different location.
Try
/*usr/bin/true;exec rexx "$0" "$@";exit # REXX */
If you need portability between systems which have true in /bin and
systems that have it in /usr/bin, you could try
/*/bin/true;exec rexx "$0" "$@";exit # REXX */
The key here is making /* a valid part of a unix path which results in
a no-op command.
--
Patrick TJ McPhee
North York Canada
pt...@interlog.com
> If you need portability between systems which have true in /bin and
> systems that have it in /usr/bin, you could try
>
> /*/bin/true;exec rexx "$0" "$@";exit # REXX */
Thanks, that works.
--
Colin Brace
Amsterdam
> /*/bin/true;exec rexx "$0" "$@";exit # REXX */
That pattern doesn't seem to match /bin/true on Linux.
I can't think of one which would match both at once.
--
---- Ian Collier : i...@comlab.ox.ac.uk : WWW page (including REXX section):
------ http://users.comlab.ox.ac.uk/ian.collier/imc.shtml
New to this group? Answers to frequently-asked questions can be had from
http://www.rexxla.org/faq.html .
It worked for me on Fedora Core 5 (2.6.15-1.2054_FC5smp), where
/bin/sh is bash 3.1.7(1)-release.
>It worked for me on Fedora Core 5 (2.6.15-1.2054_FC5smp), where
>/bin/sh is bash 3.1.7(1)-release.
How odd.
$ cat /etc/fedora-release
Fedora Core release 5 (Bordeaux)
$ uname -r
2.6.18-1.2200.fc5smp
$ rpm -q bash
bash-3.1-9.fc5.1
$ echo /*/bin/true
/*/bin/true
On this system if I execute a program starting with the above line
it says "[prog]: line 1: /*/bin/true: No such file or directory"
before running it.
I am trying to run a script as a crontab on by FreeBSD box. When cron
tries to execute the script, it returns an error message:
exec: rexx: not found
even though rexx is most definitely in the path:
# which rexx
/usr/local/bin/rexx
--
Colin Brace
Amsterdam
>exec: rexx: not found
># which rexx
>/usr/local/bin/rexx
It sounds like the PATH for crontab jobs isn't the same as your interactive
path. You may have to specify one in the crontab file if your version of
cron allows.
Or, a logical link (`ln`) from somewhere in crontab's PATH to the 'real'
REXX -- if you have those permissions.
Jonesy
--
Marvin L Jones | jonz | W3DHJ | linux
38.24N 104.55W | @ config.com | Jonesy | OS/2
*** Killfiling google posts: <http://jonz.net/ng.htm>