1. Redirecting Standard Output

Phil F recently posted a neat little utility program: Quick Listing of Routine Declarations which seems to automatically direct the program output from the screen to a file via a switch.

integer outdev 
-- 
outdev = 1 -- >> usually to console -- 
 
if length(params) < 3 then 
	puts(1,"Usage: eui qindex.ex sourcefile > [optional] keepme.txt\n") 
end if 
 
 
-- it appears that if the commandline contains " > keepme.txt" 
-- then outdev is redirected to the file "keepme.txt" although the value of 
-- outdev is never changed by euphoria commands such as:  
outdev = open("keepme.txt", w) -- or 
close(outdev) 
 
-- so is ">" an operating system "pipe"? 

? Or where is this function explained in the Euphoria Docs?

Regards, Ken

new topic     » topic index » view message » categorize

2. Re: Redirecting Standard Output

Hi Ken,

'<' and '>' are console redirection symbols. They've been used for redirecting input and output from files for a long time (since before DOS I believe).

Here's the Wikipedia article on Redirection https://en.wikipedia.org/wiki/Redirection_(computing)

It allows you to take input from a file that would normally come from a keyboard or direct output to a file that would normally go to the screen.

In this instance it allows you to save the output of the program qindex.ex rather than just see it fly by on your screen.

Hope this helps, Lonny

new topic     » goto parent     » topic index » view message » categorize

3. Re: Redirecting Standard Output

Hi again Ken,

I see that you just registered for the Forum.

How long have you been programming?

How long have you been using OpenEuphoria?

How did you find OpenEuphoria?

As they used to say, "Inquiring minds want to know." smile

new topic     » goto parent     » topic index » view message » categorize

4. Re: Redirecting Standard Output

Lnettnay said...

Hi again Ken,

I see that you just registered for the Forum.

How long have you been programming?

How long have you been using OpenEuphoria?

How did you find OpenEuphoria?

As they used to say, "Inquiring minds want to know." smile

I think he's been around here longer than me: http://openeuphoria.org/forum/m/77149.wc

Senator, if that was indeed you, congratulations on 20 years of perseverance!

new topic     » goto parent     » topic index » view message » categorize

5. Re: Redirecting Standard Output

I had a brain fart. I thought he was a new forum member from his user name. When I looked at his profile I thought the last accessed date was the registration date. I wonder why he changed his user name?

Lonny

new topic     » goto parent     » topic index » view message » categorize

6. Re: Redirecting Standard Output

petelomax said...
Lnettnay said...

Hi again Ken,

How long have you been using OpenEuphoria? ~ I wonder why he changed his user name?

Lonny

I think he's been around here longer than me: http://openeuphoria.org/forum/m/77149.wc

Senator, if that was indeed you, congratulations on 20 years of perseverance!

It is I. smile

I changed my user name because I forgot my log in code and was too impatient to wait on Rob to reset my account for whatever.

Thanks for the 20 years of perseverance congratulations!

I actually think that I discovered Euphoria in the summer of 1996. There were only a handful of user contributions at the time - perhaps 5 or 6.

In the early days Euphoria had a mailing list which was hosted by a University, if I recall correctly. I added hot keys to ed.ex which allowed me to run "pine" and download the current digest of postings and then load them into ed.ex to read. I would compose my reply/post to the mailing list in ed.ex and then use another hot key to run pine again to send the post to the mailing list. It worked like a charm - all on dial-up.

For a number of years Euphoria's documentation was text file only. The reference manual article headings contained the command enclosed with <>. It was very easy to add simple context sensitive help to ed.ex by automatically enclosing the current "word" with <>, loading the reference manual in an ed.ex window, and using ed.ex's search command to locate the relevant article. Worked like a charm.

Is progress real?

There is really no excuse for my ignorance of console redirection. I started using Linux as soon as someone on the mailing list suggested that Rob port Euphoria to Linux. I dual booted Windows and Linux for a few years, but dropped Windows out of disgust over viruses and crashes.

I chose the user name Senator because I seem to remember that the latin root meant something like "old" and it sounds a bit more dignified than "Senile". smile

Cheers, Ken Rhodes

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu