A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Windows 10 » Windows 10 Help Forum
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Need second pair of eyes for this command line



 
 
Thread Tools Rate Thread Display Modes
  #1  
Old August 24th 19, 02:48 AM posted to alt.comp.os.windows-10
T
external usenet poster
 
Posts: 4,600
Default Need second pair of eyes for this command line

Hi All,

I keep staring at this trying to figure out what
I am doing wrong. Since I sometimes think I am
seeing what I am seeing, would you guys mind
looking over it to find my typo?

wfreerdp.exe /version 2&1 eraseme.txt & type eraseme.txt
nothing

And eraseme.txt is indeed the

type eraseme.txt
This is FreeRDP version 2.0.0-dev5 (8a865546d)

What am I doing wrong?

Many thanks,
-T
Ads
  #2  
Old August 24th 19, 05:43 AM posted to alt.comp.os.windows-10
Paul[_32_]
external usenet poster
 
Posts: 11,873
Default Need second pair of eyes for this command line

T wrote:
Hi All,

I keep staring at this trying to figure out what
I am doing wrong. Since I sometimes think I am
seeing what I am seeing, would you guys mind
looking over it to find my typo?

wfreerdp.exe /version 2&1 eraseme.txt & type eraseme.txt
nothing

And eraseme.txt is indeed the

type eraseme.txt
This is FreeRDP version 2.0.0-dev5 (8a865546d)

What am I doing wrong?

Many thanks,
-T


How about:

wfreerdp.exe /version eraseme.txt 2&1 & type eraseme.txt

First you define stdout, *then* you redirect
stderr to stdout after that.

That's my guess.

*******

Here is a short program.

#include stdio.h
#include windows.h

int main() {
fprintf(stdout, "I am your stdout, Luke\n");
fprintf(stderr, "I am your stderr, Obiwan\n");
return(0);
}

Ir probably doesn't need windows.h but I was in
too much of a rush.

Here are some test results. Some redirects to prove
it uses two file handles.

https://i.postimg.cc/5y1wqyTS/stdtest-output.gif

Now to reproduce your kind of problem.

stdtest.exe eraseme.txt 2&1 & type eraseme.txt

This is what I get.

L:\stdtest eraseme.txt 2&1 & type eraseme.txt
I am your stdout, Luke
I am your stderr, Obiwan

Paul
  #3  
Old August 24th 19, 05:54 AM posted to alt.comp.os.windows-10
T
external usenet poster
 
Posts: 4,600
Default Need second pair of eyes for this command line

On 8/23/19 9:43 PM, Paul wrote:
T wrote:
Hi All,

I keep staring at this trying to figure out what
I am doing wrong.Â* Since I sometimes think I am
seeing what I am seeing, would you guys mind
looking over it to find my typo?

wfreerdp.exe /version 2&1 eraseme.txt & type eraseme.txt
nothing

And eraseme.txt is indeed the

type eraseme.txt
This is FreeRDP version 2.0.0-dev5 (8a865546d)

What am I doing wrong?

Many thanks,
-T


How about:

wfreerdp.exe /version eraseme.txt 2&1 & type eraseme.txt

First you define stdout, *then* you redirect
stderr to stdout after that.

That's my guess.

*******

Here is a short program.

#include stdio.h
#include windows.h

int main() {
Â* fprintf(stdout, "I am your stdout, Luke\n");
Â* fprintf(stderr, "I am your stderr, Obiwan\n");
Â* return(0);
}

Ir probably doesn't need windows.h but I was in
too much of a rush.

Here are some test results. Some redirects to prove
it uses two file handles.

https://i.postimg.cc/5y1wqyTS/stdtest-output.gif

Now to reproduce your kind of problem.

Â*Â* stdtest.exeÂ* eraseme.txt 2&1 & type eraseme.txt

This is what I get.

L:\stdtest eraseme.txt 2&1 & type eraseme.txt
I am your stdout, Luke
I am your stderr, Obiwan

Â*Â* Paul


Did you compile stdtest as a "Console" or a "GUI"?

Apparently wfreerdp was compiled as a "GUI"

  #4  
Old August 24th 19, 07:14 AM posted to alt.comp.os.windows-10
Lucifer
external usenet poster
 
Posts: 226
Default Need second pair of eyes for this command line

On Fri, 23 Aug 2019 18:48:36 -0700, T wrote:

Hi All,

I keep staring at this trying to figure out what
I am doing wrong. Since I sometimes think I am
seeing what I am seeing, would you guys mind
looking over it to find my typo?

wfreerdp.exe /version 2&1 eraseme.txt & type eraseme.txt
nothing

And eraseme.txt is indeed the

type eraseme.txt
This is FreeRDP version 2.0.0-dev5 (8a865546d)

What am I doing wrong?


The causes everything following to be written to.

Many thanks,
-T

  #5  
Old August 24th 19, 07:25 AM posted to alt.comp.os.windows-10
Paul[_32_]
external usenet poster
 
Posts: 11,873
Default Need second pair of eyes for this command line

T wrote:
On 8/23/19 9:43 PM, Paul wrote:
T wrote:
Hi All,

I keep staring at this trying to figure out what
I am doing wrong. Since I sometimes think I am
seeing what I am seeing, would you guys mind
looking over it to find my typo?

wfreerdp.exe /version 2&1 eraseme.txt & type eraseme.txt
nothing

And eraseme.txt is indeed the

type eraseme.txt
This is FreeRDP version 2.0.0-dev5 (8a865546d)

What am I doing wrong?

Many thanks,
-T


How about:

wfreerdp.exe /version eraseme.txt 2&1 & type eraseme.txt

First you define stdout, *then* you redirect
stderr to stdout after that.

That's my guess.

*******

Here is a short program.

#include stdio.h
#include windows.h

int main() {
fprintf(stdout, "I am your stdout, Luke\n");
fprintf(stderr, "I am your stderr, Obiwan\n");
return(0);
}

Ir probably doesn't need windows.h but I was in
too much of a rush.

Here are some test results. Some redirects to prove
it uses two file handles.

https://i.postimg.cc/5y1wqyTS/stdtest-output.gif

Now to reproduce your kind of problem.

stdtest.exe eraseme.txt 2&1 & type eraseme.txt

This is what I get.

L:\stdtest eraseme.txt 2&1 & type eraseme.txt
I am your stdout, Luke
I am your stderr, Obiwan

Paul


Did you compile stdtest as a "Console" or a "GUI"?

Apparently wfreerdp was compiled as a "GUI"


I did that in MinGW (the original 32 bit kind).
So it's likely console. I don't keep Visual Studio
on this side of the room.

Paul
  #6  
Old August 24th 19, 07:30 AM posted to alt.comp.os.windows-10
T
external usenet poster
 
Posts: 4,600
Default Need second pair of eyes for this command line

On 8/23/19 11:14 PM, Lucifer wrote:
On Fri, 23 Aug 2019 18:48:36 -0700, T wrote:

Hi All,

I keep staring at this trying to figure out what
I am doing wrong. Since I sometimes think I am
seeing what I am seeing, would you guys mind
looking over it to find my typo?

wfreerdp.exe /version 2&1 eraseme.txt & type eraseme.txt
nothing

And eraseme.txt is indeed the

type eraseme.txt
This is FreeRDP version 2.0.0-dev5 (8a865546d)

What am I doing wrong?


The causes everything following to be written to.

Many thanks,
-T


So it wasn't me, this time. Wooo Hooo!

Do you know a work around?

Thank you for the conformation

-T

Batch program is a pain in the ass!
  #7  
Old August 24th 19, 07:31 AM posted to alt.comp.os.windows-10
Carlos E.R.[_3_]
external usenet poster
 
Posts: 1,356
Default Need second pair of eyes for this command line

On 24/08/2019 03.48, T wrote:
Hi All,

I keep staring at this trying to figure out what
I am doing wrong.Â* Since I sometimes think I am
seeing what I am seeing, would you guys mind
looking over it to find my typo?

wfreerdp.exe /version 2&1 eraseme.txt & type eraseme.txt
nothing


I did not know this was valid Windows syntax. It looks bash syntax. :-?


And eraseme.txt is indeed the

type eraseme.txt
This is FreeRDP version 2.0.0-dev5 (8a865546d)

What am I doing wrong?

Many thanks,
-T



--
Cheers, Carlos.
  #8  
Old August 24th 19, 07:40 AM posted to alt.comp.os.windows-10
T
external usenet poster
 
Posts: 4,600
Default Need second pair of eyes for this command line

On 8/23/19 11:31 PM, Carlos E.R. wrote:
wfreerdp.exe /version 2&1 eraseme.txt & type eraseme.txt
nothing

I did not know this was valid Windows syntax. It looks bash syntax. :-?


Hi Carlos,

Ya it does, doesn't it.

If this was bash, it would be a piece of cake. Windows
batch programming sucks.

-T


How do I run two commands in one line in Windows CMD?:
https://stackoverflow.com/questions/...ws-cmd#8055390

You can use the special characters listed in the following table to pass
multiple commands.

& [...]
command1 & command2
Use to separate multiple commands on one command line. Cmd.exe runs the
first command, and then the second command.

&& [...]
command1 && command2
Use to run the command following && only if the command preceding the
symbol is successful. Cmd.exe runs the first command, and then runs the
second command only if the first command completed successfully.

|| [...]
command1 || command2
Use to run the command following || only if the command preceding ||
fails. Cmd.exe runs the first command, and then runs the second command
only if the first command did not complete successfully (receives an
error code greater than zero).

( ) [...]
(command1 & command2)
Use to group or nest multiple commands.

; or ,
command1 parameter1;parameter2
Use to separate command parameters.
  #9  
Old August 24th 19, 08:16 AM posted to alt.comp.os.windows-10
Carlos E.R.[_3_]
external usenet poster
 
Posts: 1,356
Default Need second pair of eyes for this command line

On 24/08/2019 08.40, T wrote:
On 8/23/19 11:31 PM, Carlos E.R. wrote:
wfreerdp.exe /version 2&1 eraseme.txt & type eraseme.txt
nothing

I did not know this was valid Windows syntax. It looks bash syntax. :-?


Hi Carlos,

Ya it does, doesn't it.

If this was bash, it would be a piece of cake.Â* Windows
batch programming sucks.



Now that I think again (after breakfast tea) :-)

The "type" above (in bash) would run simultaneously with the
wfreerdp.exe, thus when the file has been set to zero bytes and displays
empty. In bash, you would use ";" or "&&" to concatenate commands (with
";" runs always, with "&&" only after success).




How do I run two commands in one line in Windows CMD?:
https://stackoverflow.com/questions/...ws-cmd#8055390


Ah, windows CMS, which is not command.com shell.
This is important, windows now has several shells. command.com, cms,
powershell, and now also some kind of bash :-?


You can use the special characters listed in the following table to pass
multiple commands.

& [...]
command1 & command2
Use to separate multiple commands on one command line. Cmd.exe runs the
first command, and then the second command.


Thus different than bash, unless they made a mistake or syntax changed
to be like bash.


&& [...]
command1 && command2
Use to run the command following && only if the command preceding the
symbol is successful. Cmd.exe runs the first command, and then runs the
second command only if the first command completed successfully.


This is like bash.


|| [...]
command1 || command2
Use to run the command following || only if the command preceding ||
fails. Cmd.exe runs the first command, and then runs the second command
only if the first command did not complete successfully (receives an
error code greater than zero).


Like bash.


( ) [...]
(command1 & command2)
Use to group or nest multiple commands.


Like bash, I think.


; or ,
command1 parameter1;parameter2
Use to separate command parameters.


like bash the ";". I don't know about the ",".

--
Cheers, Carlos.
  #10  
Old August 25th 19, 11:00 AM posted to alt.comp.os.windows-10
Chris
external usenet poster
 
Posts: 832
Default Need second pair of eyes for this command line

Carlos E.R. wrote:
On 24/08/2019 08.40, T wrote:
On 8/23/19 11:31 PM, Carlos E.R. wrote:
wfreerdp.exe /version 2&1 eraseme.txt & type eraseme.txt
nothing
I did not know this was valid Windows syntax. It looks bash syntax. :-?


Hi Carlos,

Ya it does, doesn't it.

If this was bash, it would be a piece of cake.Â* Windows
batch programming sucks.



Now that I think again (after breakfast tea) :-)

The "type" above (in bash) would run simultaneously with the
wfreerdp.exe, thus when the file has been set to zero bytes and displays
empty. In bash, you would use ";" or "&&" to concatenate commands (with
";" runs always, with "&&" only after success).




How do I run two commands in one line in Windows CMD?:
https://stackoverflow.com/questions/...ws-cmd#8055390


Ah, windows CMS, which is not command.com shell.
This is important, windows now has several shells. command.com, cms,
powershell, and now also some kind of bash :-?


You can use the special characters listed in the following table to pass
multiple commands.

& [...]
command1 & command2
Use to separate multiple commands on one command line. Cmd.exe runs the
first command, and then the second command.


Thus different than bash, unless they made a mistake or syntax changed
to be like bash.


& At the end of a command in bash runs it in the background.


&& [...]
command1 && command2
Use to run the command following && only if the command preceding the
symbol is successful. Cmd.exe runs the first command, and then runs the
second command only if the first command completed successfully.


This is like bash.


|| [...]
command1 || command2
Use to run the command following || only if the command preceding ||
fails. Cmd.exe runs the first command, and then runs the second command
only if the first command did not complete successfully (receives an
error code greater than zero).


Like bash.


( ) [...]
(command1 & command2)
Use to group or nest multiple commands.


Like bash, I think.


Not really
https://linuxconfig.org/bash-scripti...esis-explained


; or ,
command1 parameter1;parameter2
Use to separate command parameters.


like bash the ";". I don't know about the ",".


; In bash allows you to run multiple commands on the same line, not
separate command parameters. Whitespace separates parameters in bash.


  #11  
Old August 25th 19, 02:26 PM posted to alt.comp.os.windows-10
Carlos E.R.[_3_]
external usenet poster
 
Posts: 1,356
Default Need second pair of eyes for this command line

On 25/08/2019 12.00, Chris wrote:
Carlos E.R. wrote:
On 24/08/2019 08.40, T wrote:
On 8/23/19 11:31 PM, Carlos E.R. wrote:
wfreerdp.exe /version 2&1 eraseme.txt & type eraseme.txt
nothing
I did not know this was valid Windows syntax. It looks bash syntax. :-?


Hi Carlos,

Ya it does, doesn't it.

If this was bash, it would be a piece of cake.Â* Windows
batch programming sucks.



Now that I think again (after breakfast tea) :-)

The "type" above (in bash) would run simultaneously with the
wfreerdp.exe, thus when the file has been set to zero bytes and displays
empty. In bash, you would use ";" or "&&" to concatenate commands (with
";" runs always, with "&&" only after success).




How do I run two commands in one line in Windows CMD?:
https://stackoverflow.com/questions/...ws-cmd#8055390


Ah, windows CMS, which is not command.com shell.
This is important, windows now has several shells. command.com, cms,
powershell, and now also some kind of bash :-?


You can use the special characters listed in the following table to pass
multiple commands.

& [...]
command1 & command2
Use to separate multiple commands on one command line. Cmd.exe runs the
first command, and then the second command.


Thus different than bash, unless they made a mistake or syntax changed
to be like bash.


& At the end of a command in bash runs it in the background.


Exactly. Which would make the two commands to run simultaneously, and
the "type file" would get an empty file, explaining the result that he gets.



--
Cheers, Carlos.
 




Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off






All times are GMT +1. The time now is 07:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.