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
----------------------------------------------------------------------------
>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
>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
>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
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 --
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 |
+=================================+================================+