Mail Archives: djgpp/1997/01/23/11:47:38
Adrian Oboroc wrote:
>
> Sorry men, but I think using redir isn't too comfortable (but it's a
> working solution, of couse), and using DOS-port of BASH is easy only for
> persons with previous experiense in UNIX ( not my case :~( )
4DOS also can redirect command line arguments Unix-style. The real
problem is DOS, which cannot easily be worked around.
> Probably the best solution is to rewrite startup code in such a way, that
> it will:
> A) pre-check command line parameters, and pass to main program only
> part before ">", ">&" and "<" combinations
> B) perform the redirection of output from stdout (and stderr for ">&")
> to a file, mentioned after ">" or ">&" operation.
> C) check for "<" sign and redirect file after this symbol to stdin.
Simply put, this is not possible, because DOS gets to see the command
lines before they ever get to the DJGPP startup code, and it's DOS that
processes '>', '<', and '|'. If you write '>&' in your command line,
DOS tries to redirect stdout to a file named "&", and naturally fails.
The DJGPP program that would have handled the request never gets run.
> builded with DJGPP. And many of them for shure will try something like
> "someprog.exe /? > info.txt" to get short instructions in text file
Most such programs output the help text to stdout instead of stderr. At
least, all of mine do. Stderr is mostly used for (tada!) errors. ;)
Since DJGPP is a Unix-based compiler, users who are used to DOSisms
really ought to be prepared to expect differences.
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com |
| Call me for your free AOL disk! | http://www.cs.com/fighteer |
| Chain letters, work-at-home schemes, free long distance, etc., |
| are ILLEGAL! Keep the Internet litter-free... don't SPAM. |
---------------------------------------------------------------------
- Raw text -