Howdy t:
> rebol under linux, revisited
>
> Hey guys,
>
> I'm not exactly straight about the location of things under
> linux. I followed a thread on here a while back to get
> what I have, which is the a rebol directory with everything
> in it in /user/local/share/rebol, and the rebol executable
> in /usr/local/bin. I don't remember the syntax, but I also
> did export REBOL_HOME (as suggested by that post I read).
>
> Now all the scripts have to be in my home directory for
> rebol to see them. rebol sees nothing in
> user/local/share/rebol. I tried copying the executable to
> the same directory, then just linking it to usr/local/bin,
> but that didn't do much.
>
> any suggestions?
>
> -t
Well, Erin ([EMAIL PROTECTED]) might have a different
perspective for you (he's our resident Unix guru) but here's
my advice for what it's worth:
You have total flexibility with your installation of REBOL
under unix.
However, there are typical conventions:
usr/bin/
This is where fundemental core executables go: gzip, finger,
telnet, often times shells are located in here, editors,
compilers. Frequently you'll find languages here as well.
usr/local/bin
As the local suggests, this is where you put executables
that are "non-standard", less used, experimental, etc.
Sometimes usr/local/bin is higher in the path chain than
usr/bin, so this is how people try out a new version of
something, ie: you have rebol 2.1.2 in usr/bin and you see
core beta 2.2 so you put it in usr/local/bin. Now when
someone types rebol at the command line the beta pops up
because the shell checks usr/local/bin before it gets to
/usr/bin.
So now you made a useful script that you want to use from
wherever. Let's use a real example:
#!/usr/local/bin/rebol -s
REBOL [Title: "Delete zero size files"]
do-ask: found? find system/options/args "-i"
foreach file (load %.) [
if 0 = size? file [
if not all [
do-ask not confirm reform ["delete" file "?"]
][delete file]
]
]
Okay-- so you verify it works (make sure the "interpreter
line" points at the absolute path to the REBOL binary).
Then if you just want to use it call it rmz, perhaps, make
it executable by the owner (chmod u+x rmz) and drop it into
your private bin/
private bin/
Typically this is a directory right off your home directory
which contains scripts and other personal use items. Your
personal bin directory needs to be loaded into your path,
typically in your .profile, or .login, or .cshrc, or
.bashrc, etc: by doing something like:
export PATH=$HOME/bin/:$PATH
(That's BASH syntax).
So now your script is doable from anywhere.
Lets say you wanted to create scripts for everyone to use on
the system, you could do the same as above, but making the
script group or other executable (chmod og+x script) and
dropping them in usr/local/bin/
.. but that could get kind of messy, so maybe you make a
directory under usr/local/ called rebol/ and you add that to
the system path in /etc/profile, then everyone can execute
them from anywhere. (etc/profile gets run by everyone's
shell before their own .login, .profile, .whatever).
It's entirely up to you.. just pick a system and go with
it. Move scripts into a spot and add the spot to the path.
I've made it sound more complicated than it is.. anyhow..
Good luck!
-jeff