SCOUG Logo


Next Meeting: Sat, TBD
Meeting Directions


Be a Member
Join SCOUG

Navigation:


Help with Searching

20 Most Recent Documents
Search Archives
Index by date, title, author, category.


Features:

Mr. Know-It-All
Ink
Download!










SCOUG:

Home

Email Lists

SIGs (Internet, General Interest, Programming, Network, more..)

Online Chats

Business

Past Presentations

Credits

Submissions

Contact SCOUG

Copyright SCOUG



warp expowest
Pictures from Sept. 1999

The views expressed in articles on this site are those of their authors.

warptech
SCOUG was there!


Copyright 1998-2024, Southern California OS/2 User Group. ALL RIGHTS RESERVED.

SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group. OS/2, Workplace Shell, and IBM are registered trademarks of International Business Machines Corporation. All other trademarks remain the property of their respective owners.

The Southern California OS/2 User Group
USA

SCOUG-Programming Mailing List Archives

Return to [ 16 | November | 1998 ]

<< Previous Message << >> Next Message >>


Date: Mon, 16 Nov 1998 05:10:14 PDT
From: dallasii@kincyb.com
Reply-To: scoug-programming@scoug.com
To: scoug-programming@scoug.com
Subject: SCOUG-Programming: More2QUEUE2,2Full2Disc

SL>
SL> Date: Sat, 14 Nov 1998 11:03:44 PDT
SL> Reply-To: scoug-programming@scoug.com
SL> From: Steven Levine
SL> To: scoug-programming@scoug.com
SL> Subject: SCOUG-Programming: More\1b[1;33m2queueing\1b[0m
SL>
SL> In , on 11/14/98
SL> at 02:28 AM, dallasii@kincyb.com said:
SL>
SL> >in my test7, and it started working.
SL> >Still doodling around with the thing to learn more about
SL> >what is going on, and will keep you posted.
SL> >I've been able to 'CALL' a pipeline that starts with
SL> >test8.cmd, but not 'start' one, and still don't understand why the Qnew
SL> >has the space appended to it.
SL>
SL> Oh, I like easy questions :^). Can you say multi-tasking. It's the

Yeah, that solved it OK.

SL> timing. START does not wait for test8 to complete before continuing with
SL> test7. You are clearing out the queue before you have a chance to read
SL> it. With CALL or CMD, Test7 does not continue until test8 finishes.
SL>
SL> Qnew has a space "prepended" because you have 2 spaces before 'Qnew'. The
SL> first is discarded. The 2nd becomes part of the argument passed to test8.
SL> Not what you expected, but that's the way it works. You'll notice I tend
SL> to be fussy about spaces in my code. There's a reason.

I ran into some other problems due to using PD Korn Shell as my
commandline - first really tricky problem it's given me.
As best I can figure, there were so many environment variables pointed
at so many different shells, that some where along the way for the
attempted pipe the shell got swapped and the fact that there was
a pipe being processed seemed to get dropped.
Also, START doesn't seem to like pipes for whatever reasons -
DETACH seems to handle them more reliably from this environment.
On one of the exploritory kludges, LineOut seemed to choke outputing
a '|' character.

This still doesn't start the pipe first, then read the queue to
standard output for the pipe as data is fed to it yet, but maybe
that is doable now that I've got this working.

Here's the interesting stuff:

/* test7.cmd exerpts: */

CALL QUEUE2PIPE Qnew, ' | sed -n "/^REM/p" > test9.txt '
/* This seems the smoothest solution to me */

/*
Worked:

ADDRESS CMD 'detach cmd /q /s /c " cmd /c call test8.cmd 'Qnew' | sed -n "/R
EM/p" > test9.txt " '
ADDRESS CMD 'detach cmd /q /s /c call test8.cmd 'Qnew' > test9.txt '
CALL QUEUE2PIPE Qnew, ' | sed -n "/^REM/p" > test9.txt '
CALL PIPE '@CMD /C test8.cmd 'Qnew' | sed -n "/^REM/p" > test9.txt '
'set comspec=M:\cmd.exe & start /b /C call test8.cmd 'Qnew' | sed -n "/^REM/
p" > test9.txt '
....sort of but didn't go into background in Korn shell - hung in fg
' ( cmd.exe /s /q /c call test8.cmd 'Qnew' | sed -n "/^REM/p" > test9.txt )
& '
....sort of but didn't go into background in Korn shell - hung in fg
'start /b /C call test8.cmd 'Qnew' | sed -n "/^REM/p" > test9.txt '
above OK in native OS/2 command line interpreter
////////// ************
WORK='@CMD /C test8.cmd 'Qnew' | sed -n "/^REM/p" > test9.txt '
'detach cmd.exe /q /s /c " 'WORK ' " '
drop WORK
********* ////////////
////////// ************
WORK='"@CMD /C test8.cmd 'Qnew' | sed -n "/^REM/p" > test9.txt" '
'detach cmd.exe /q /s /c 'WORK
drop WORK
********* ////////////
////////// ************
'if exist 'Qnew'.CMD erase 'Qnew'.CMD > NUL '
call lineout Qnew'.CMD ' , '@CMD /C test8.cmd 'Qnew' 'D2C(124)' sed -n "/REM/p
" > test9.txt '
'detach cmd.exe /q /s /c 'Qnew'.CMD' /* '|' apparently gave
lineout fits */
********* ////////////
'detach cmd /c CALL test8.cmd 'Qnew' > test9.txt '
'@CMD /C test8.cmd 'Qnew' | sed -n "/^REM/p" '
'@CMD /C CALL test8.cmd 'Qnew' | sed -n "/^REM/p" '
'@CMD /C test8.cmd 'Qnew' | sed -n "/^REM/p" > test9.txt '
'@CALL test8.cmd 'Qnew' '
*/

/*
Didn't work:

ADDRESS CMD 'detach cmd /q /s /c " call test8.cmd 'Qnew' | sed -n "/REM/p"
> test9.txt " '
ADDRESS CMD 'detach cmd /q /s /c call test8.cmd 'Qnew' | sed -n "/^REM/p"
> test9.txt '
ADDRESS CMD 'start /b /C call test8.cmd 'Qnew' | sed -n "/^REM/p" > test9.t
xt '
'@start /n "cmd /c CALL test8.cmd 'Qnew' | sed -n ''/^REM/p'' > test9.txt"
'
'start /b /PGM " call set comspec=m:\cmd.exe & cmd /c call test8.cmd 'Qnew
' | sed -n "/^REM/p" > test9.txt " /C '
'COMSPEC=M:\cmd.exe start /b /C call test8.cmd 'Qnew' | sed -n "/^REM/p" >
test9.txt '
'start /b /I /C " ( cmd /s /q /c call test8.cmd 'Qnew' 'D2C(124)' sed -n ''/^RE
M/p'' > test9.txt ) " '
'set comspec=M:\cmd.exe & start /b /C " ( call test8.cmd 'Qnew' | sed -n
''/^REM/p'' > test9.txt ) " '
'start /b /k cmd /Q /c " ( CALL test8.cmd 'Qnew' | sort > test9.txt ) "
'
'start /k "cmd /c CALL test8.cmd 'Qnew' > test9.txt " '
'@start "cmd /c CALL test8.cmd 'Qnew' > test9.txt " '
'@start /PGM "cmd /c CALL test8.cmd 'Qnew' > test9.txt & dir test9.txt" '
'@start /C "cmd /c CALL test8.cmd 'Qnew' > test9.txt" '
'@start /C "cmd /c CALL test8.cmd 'Qnew' | sed -n ''/^REM/p'' > test9.txt"
'
'@start /C "CALL test8.cmd 'Qnew' | sed -n ''/^REM/p'' > test9.txt" '
'@start /C ( CALL test8.cmd 'Qnew' | sed -n "/^REM/p" > test9.txt ) '
'@start /C CALL test8.cmd 'Qnew' | sed -n "/^REM/p" > test9.txt '
'@start /C test8.cmd 'Qnew' | sed -n "/^REM/p" > test9.txt '
'@CALL test8.cmd 'Qnew' | sed -n "/^REM/p" '
'@CALL test8.cmd 'Qnew' | sed -n "/^REM/p" > test9.txt '
*/

/*
CALL RXQUEUE 'delete', Qnew <----- Cause of problem pointed out by
Steve Levine
*/

SAY 'Finished.....'

EXIT

PIPE: PROCEDURE
/*
CALL PIPE '@CMD /C test8.cmd 'Qnew' | sed -n "/^REM/p" > test9.txt '
*/

PARSE ARG WORK
'detach cmd.exe /q /s /c " 'WORK ' " '

return 0

QUEUE2PIPE: PROCEDURE
/*
CALL QUEUE2PIPE Qnew, ' | sed -n "/^REM/p" > test9.txt '
*/

PARSE ARG THEQ, THEPIPE
/* SAY 'detach cmd.exe /q /s /c " @CMD /C test8.cmd 'THEQ' 'THEPIPE' " '
*/
'detach cmd.exe /q /s /c " @CMD /C test8.cmd 'THEQ' 'THEPIPE' " '

return 0

/************************************************************/

/* ReXX */

/* last TEST8.cmd version */
/* candidate for 'EUEUQXR.CMD' */

PARSE UPPER ARG Qgiven
Qgiven = Strip(Qgiven)

Qold = RXQUEUE('Set', Qgiven )

DO WHILE ( Queued() >< 0 )

inline1 = LineIn( 'QUEUE:' )
call lineout 'STDOUT:', inline1
END

call RXQUEUE 'delete', Qgiven
call RXQUEUE 'set', Qold
EXIT

Regards,
Dallas E. Legan II
(562) 862 - 4854 ext. '*'

L
E
G
A
N
@
A
C
M
.
O
R
G

=====================================================

To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".

For problems, contact the list owner at
"rollin@scoug.com".

=====================================================


<< Previous Message << >> Next Message >>

Return to [ 16 | November | 1998 ]



The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA

Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS RESERVED.

SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group. OS/2, Workplace Shell, and IBM are registered trademarks of International Business Machines Corporation. All other trademarks remain the property of their respective owners.