Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

another 4OS2 bug

2 views
Skip to first unread message

Rainer Peipp

unread,
Jun 16, 1993, 4:33:11 AM6/16/93
to
Hello,

i am running 4OS2/16 V1.11 (/16 because of IBM's TCP/IP) and tried the
following command:

dir /f | set file=%@select[con,1,1,25,80,please select]

I expected to set the environment variable "file" with the choosen line in
the select box. But what happens is, that "file" is not an defined
environment variable.

Even the (useless) command

dir | set file=test

does not set file.

With 4DOS 4.02 everything works like expected.

Any suggestions ?
---
----------------------------------------------------------------------------
Dipl.-Ing. Rainer Peipp e-mail: pe...@fge.informatik.uni-erlangen.de
Informatik Forschungsgruppe E Tel.+49 9131 85-7870; Fax.+49 9131 85-7832
Universitaet Erlangen-Nuernberg Martensstr. 3, W-8520 Erlangen, Germany
----------------------------------------------------------------------------

Clemens Beckstein

unread,
Jun 16, 1993, 5:17:06 AM6/16/93
to
pe...@fge.informatik.uni-erlangen.de (Rainer Peipp) writes:

>Hello,

>i am running 4OS2/16 V1.11 (/16 because of IBM's TCP/IP) and tried the
>following command:

>dir /f | set file=%@select[con,1,1,25,80,please select]

>I expected to set the environment variable "file" with the choosen line in
>the select box. But what happens is, that "file" is not an defined
>environment variable.

>Even the (useless) command

>dir | set file=test

>does not set file.

>With 4DOS 4.02 everything works like expected.

>Any suggestions ?

no bug but a feature of OS/2 and pipes...

the set is done in a separate process from the one starting the pipe
(with its own copy of the environment);

This is documented in the 4OS2 manual!

- Clemens

Rainer Peipp

unread,
Jun 16, 1993, 5:47:55 AM6/16/93
to
cle...@immd8.informatik.uni-erlangen.de (Clemens Beckstein) writes:

>pe...@fge.informatik.uni-erlangen.de (Rainer Peipp) writes:

>>Hello,

>>Even the (useless) command

>>dir | set file=test

>>does not set file.

>>Any suggestions ?

>- Clemens

Under UNIX piping is also done in seperate processes, but

ls | set file=test

does set file to test.

Why should 4OS2 work different?


Rainer

Clemens Beckstein

unread,
Jun 16, 1993, 7:25:36 AM6/16/93
to
pe...@fge.informatik.uni-erlangen.de (Rainer Peipp) writes:

>cle...@immd8.informatik.uni-erlangen.de (Clemens Beckstein) writes:

>>pe...@fge.informatik.uni-erlangen.de (Rainer Peipp) writes:

>>>Hello,

>>>i am running 4OS2/16 V1.11 (/16 because of IBM's TCP/IP) and tried the
>>>following command:

>>>dir /f | set file=%@select[con,1,1,25,80,please select]

>>>I expected to set the environment variable "file" with the choosen line in
>>>the select box. But what happens is, that "file" is not an defined
>>>environment variable.

>>>Even the (useless) command

>>>dir | set file=test

>>>does not set file.

>>>With 4DOS 4.02 everything works like expected.

>>>Any suggestions ?

>>no bug but a feature of OS/2 and pipes...

>>the set is done in a separate process from the one starting the pipe
>>(with its own copy of the environment);

>>This is documented in the 4OS2 manual!

>>- Clemens

>Under UNIX piping is also done in seperate processes, but

>ls | set file=test

>does set file to test.

how can you be sure what exactly (environmentwise) your shell (which
one BTW: sh, csh, zsh, tcsh, bash, ...?) does with this pipe?

>Why should 4OS2 work different?

different than what --- DOS, OS/2 or Unix?
if you mean Unix, then the answer is
because 4OS2 is written for OS/2...

point is, OS/2 handles the pipe the way you describe and it does it
the same way both under CMD.EXE and 4OS2
which is documented at least in the 4OS2 manual

Cheers,

- Clemens

Fredric Lonngren

unread,
Jun 16, 1993, 10:28:22 AM6/16/93
to
[Alot about piping to variable not the same between 4os2 and 4dos deleted]

OK,ok,ok so you cant pipe a value to a variable in 4os2 because the
variable will belong to the shell on the other side of the pipe.
And yes it's stated in the dox. Good. Fine. Great. But ....

HOW do we do this instead ????

Most of my more advanced .btm's has some variant of this method implemented.
Ie.
:loop
(echo `C:\config.sys `
echo `C:\autoexec.bat `
echo `C:\BIN\4DOS\4dos.ini `
echo `C:\BIN\4DOS\aliases.fln `
echo `C:\BIN\4DOS\asociate.ext`
echo `C:\BIN\4DOS\4start.btm `
echo `C:\BIN\4DOS\4exit.btm `
echo `C:\WIN\win.ini `
echo `C:\WIN\system.ini `)|set fname=%@select[CON,3,26,20,52, Edit System File ]
iff not "%fname" eq "" then
call ke.bat %fname
goto loop
endiff

Great way to get a value from a nice menu.
How do I solve this in 4os2 ?
Ideas?
--
Disclaimer: Did _I_ say that ?

-- F r e d r i c L o n n g r e n --
==== Ericsson Telecom AB Email : Fredric....@eos.ericsson.se ====
-====== EO/ETX/TX/VH Memo : ERI.ETX.ETXFLN ======-
==== 126 25 STOCKHOLM Voice : + 46 8 719 5226 * OS/2 2.1 * ====
-- SWEDEN Fax : + 46 8 719 5557 --

Jonathan Arnold

unread,
Jun 21, 1993, 8:42:22 AM6/21/93
to
In article <1993Jun16.1...@ericsson.se> Fredric....@eos.ericsson.se (Fredric Lonngren) writes:
>[Alot about piping to variable not the same between 4os2 and 4dos deleted]
>Great way to get a value from a nice menu.
>How do I solve this in 4os2 ?
>Ideas?

I agree - I found this to be a real pain. The only work around I
found was to pipe the stuff into a file and then read the file (yech).
But at least it worked.

+=================================+================================+
| Jonathan Arnold | Interleaf, Inc. |
| jdar...@ileaf.com | Prospect Place |
| Home: (617)335-5457 | 9 Hillside Avenue |
| Bus: (617)290-4990 x5489 | Waltham, MA 02154 |
+=================================+================================+

0 new messages