3

Recently I play with an awesome programming language red. After I downloaded it on my Linux Box, and typed red --version, I got something unexpected:

$ red --version
GNU ed version 0.2

then I look up ed's manual, it's said it also named red, but don't explain why? So does anyone know the secret history of ed's name, maybe it's a wonderful story. ;-)

Sonny
  • 182
  • 1
  • 1
  • 9
  • I answered, but your question is doubly off-topic here: first, because an easy web search gives you the answer (googling for `GNU ed red`) and then because your question is not related to source code or programming. At last, please **read software documentation** before asking questions.... And current version of GNU `ed` is 1.9! – Basile Starynkevitch Oct 12 '13 at 10:28
  • Helpful to know for people using red, and there should be an official "workaround". But please see ["what constitutes an on-topic question on StackOverflow"](http://stackoverflow.com/help/on-topic). *(You can feel free to bring up this kind of issue in the [chat room](http://chat.stackoverflow.com/rooms/291/rebol-and-red), just not the Q&A...)* – HostileFork says dont trust SE Oct 12 '13 at 12:38
  • @BasileStarynkevitch: in my very humble opinion, the question had definitely something to do with programming: Red (Red language) is totally about programming, and it is in its very early days of development. So all people involved in Red, trying to run red are, by all means, involved in programming. – Pierre Oct 13 '13 at 10:01
  • I would suggest the community working on the Red programming language to install their compiler as something else than `red` (e.g. `redc`, `redlang` ...) or at least to document the possible clash with GNU `ed` in restricted mode. – Basile Starynkevitch Oct 13 '13 at 10:05

2 Answers2

2

Read GNU ed documentation, chapter on invoking ed. Running red is like running ed -r i.e. running it in ....

-r
--restricted
Run in restricted mode. This mode disables edition of files out of 
the current directory and execution of shell commands. 

BTW, bash (and several other utilities) have a restricted mode also, e.g. when invoked as rbash ....

And GNU ed manual says

A restricted version of ed, red, can only edit files in the current directory and cannot execute shell commands.

BTW, perhaps your red compiler got installed at some different path like /usr/local/bin/red. Try typing this (or some similar) path in full to invoke it. Learn about the role of PATH e.g. in environ(7) and execvp(3) etc... Perhaps edit your .bashrc to change your PATH or add a symlink from $HOME/bin/red to e.g. /usr/local/bin/red

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
1

The same happened to me a while ago, and it thought that Red had been packaged for my favourite Debian! Hélas, not.

I noted that the "red" executable belonging to ed package is /only a symlink to ed, at least on my debian:

  # pierre@autan: ~        < 2013_10_13__12_16_23 >
ll /usr/bin/red
lrwxrwxrwx 1 root root 7 mai   12 19:10 /usr/bin/red -> /bin/ed

This leads to a point that I brought, a few months ago: I find that the name "Red" is a bit too general, and may be confusing. WHile googling "rebol" leads to many relevant matches, googling "red" leads to a tremendous amount of irrelevant stuff. However, as @DocKimbel (Red's author) pointed out, googling "red language" immediately leads to relevant URLs.

Now, what to do:

  1. from Red's side: change "red" to another name, like red_lang ? so that ed and its red "alias" may still be used
  2. from ed's side: get in the package and have it remove the red symlink. We should carefully check for dependencies.

Note that the first option is about programming: the future of Red, which is coming to life right now, depends on these kind of "details", and it concerns all programmers who will be coding in Red soon (plenty!;)). The second option is not about programming at all: mea culpa.

As @HostileFork pointed out on https://chat.stackoverflow.com/rooms/291/rebol-and-red , ed is quite an old-fashioned tool: I suppose it must be still /only used by some scripts, and not that much by "normally-minded" human beings.

(I drifted a bit off-opic, didn't I? Sorry...)

Community
  • 1
  • 1
Pierre
  • 530
  • 5
  • 13