A (presumbly pretty simple) SafeChars plugin request...

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
#1
I would like to do a "SafeEcho", but to standard error and not to standard ouput. If there's some way of doing this using "redirection redirection" (i.e. "1>&2") I haven't been able to get it to work. Maybe there's a way to do the previous that I haven't found and the following is unnecessary, but I think it would be very nice to have "SafeEchoErr" and "SafeEchoSErr" commands. (And I tend to think that if redirecting the output of the "Echo" command to standard error easy, there would be no need for "EchoErr" and "EchoSErr". But I could be wrong....)
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,385
39
Albuquerque, NM
prospero.unm.edu
#2
I would like to do a "SafeEcho", but to standard error and not to standard ouput. If there's some way of doing this using "redirection redirection" (i.e. "1>&2") I haven't been able to get it to work. Maybe there's a way to do the previous that I haven't found and the following is unnecessary, but I think it would be very nice to have "SafeEchoErr" and "SafeEchoSErr" commands. (And I tend to think that if redirecting the output of the "Echo" command to standard error easy, there would be no need for "EchoErr" and "EchoSErr". But I could be wrong....)
1>&2 works for me, sending the output text to stderr.

Mind you, it doesn't get colored as I would expect -- the ErrorColors specified in my .INI file don't appear. But that's true for internal commands as well; ECHO TEST 1>&2 sends text to standard error, but doesn't color it. I don't know why that is, but coloring stdout probably involves adding code to every place that prints text to stdout, and catching this kind of redirection may be difficult or impractical for Rex. I just don't know.
 
#3
1>&2 works for me, sending the output text to stderr.

Mind you, it doesn't get colored as I would expect -- the ErrorColors specified in my .INI file don't appear.
Thank you, Charles; I don't think I need to tell you that you are correct. (Maybe the wrong colors were misleading me yesterday, but for some reason I at least thought I was correct before making the posting. My oft-mentioned memory issues could have something to do with it...) Although the "wrong color" issue might make it worthwhile to implement "SafeEchoErr" and "SafeEchoSErr" functions.

Notice that I am avoiding bold and italic fonts in theses postings because I've had some complaints about them in the past, but it is hard (and the urge to bold the previous "is" was almost overwhelming... ; > ) >