Subj : detecting rediection (dos) To : All From : Jasen Betts Date : Sat Mar 30 2002 12:26 am From: Jasen.Betts@p42.f531.n640.z3.cereal.mv.com (Jasen Betts) Subject: detecting rediection (dos) Hi All. a few weeks ago I asked about detecting redirection the consensus was 4dos can't do it... so I made a little assembler program is_red (included with source at the end of this message) no I can use pipes to buerg's list without specifying /s l*ist= c:\util\list.com %@if[ %@exec[c:\util\is_red Input] == 0 ,/s,] And here's a 'man' command that's compatible with gnu info. (if gnu info can't find the target it tries to "man" it and expects somthing on stdout) ::: (MAN.BTM) @echo off setlocal set z= for x in (c:\docs\man\%1.*) set z=%z %@altname["%X"] :: look for descriptions conatining %1 as a word ` for` /I"* %1 *" x in (c:\docs\man\*.*) set z=%%z %%@altname["%%%%X"] ` for` /I"%1" x in (c:\docs\man\*.*) set z=%%z %%@altname["%%%%X"] ` for` /I"%1 *" x in (c:\docs\man\*.*) set z=%%z %%@altname["%%%%X"] ` for` /I"* %1" x in (c:\docs\man\*.*) set z=%%z %%@altname["%%%%X"] :: crazy but it's true: work-aroud for some 'bug' in the for command is_red output iff errorlevel 1 then if (%z) ne () list %@strip[%=", %z] echo "Nothing matches %1" else if (%z) ne () type %@strip[%=", %z] if (%z) == () ( echo nothing ^ stuff 'q' ) endiff :: (stuff is a non-resident keyboard stuffer) begin 644 IS_RED.LZH h6v6hP4Uk9GY++++d++++9EVy90+-0YZHLp73F0t1Hor5+Io++DmUUU0t1+0zD h6E5mfh5doSa7mvU+FAoVWR1Ek0E-h2nB6KJ3AX7jHn2l6uIhP4Up9LE-++09m h+U++5+Vy90+-0YZHLp73F0t-IopMjIo+++4DMdfJiFEn5cLDzkyrUdKqas0O3 hcs050XUu01V6b5f7uhUGmIYZpez55oavdkxpI0dheJpT-lO44Fws4iid1fCFU heY3jW2VAUV4DQ5t0AZgRvYyjqZDwQ6+jsLx4I5u+UfAc2eFk3ABoMclkMtHRF hZb2OgpCBUDTgTtOkH8k5lRgo57JhhjXF++3h9BwCEylFBkyNmZ2RjBH8CIT6s hOvMcB3BcH5Ihr35EFTh-BhYaM8X1hIWPEqVG4g5zi-O0ZRy6aBIK4VnKDZB37 hMIhyfNg+jb1txsODEK-Nt3gqLLUhA8ZGy1Hu4oL1V84ly6159Mcd5uwUqypP6 hSC4FBWZRuJjzt0uwTqnJLDvzELrLTKic8ObIUoTo-BgzDjknzLMmhv9wCkpgh hgYK9HEo1pRzYzlIIQNzwsIejMIvH5SlKxRGryO6aL9jdRvCD4uvB1AR6MLtyB aYVSwx+xgoJD0YtR-1jFNqQJShnLJF9wU3sXkDmkkTnjjw7m8uU085 ++ end -=> Bye <=- -- |Fidonet: Jasen Betts 3:640/531.42 | | Origin: The Cereal Port BBS (603)899-3335 199.125.78.133 (1:132/152) --- # Origin: (1:132/152.4) * Origin: Baddog BBS (1:218/903) .