[edk2] @echo -off doesn't work in a script

2013-02-12 Thread Stephen Polkowski
Hi all,

Shouldn't @echo -off work in a .nsh script.  It doesn't on the latest 
UDK2010.SR1.UP1 shell.  It only hides the echo -off command.  The
commands that follow it are echoed to the screen.

Am I missing something.

Thanks in advance,

Stephen


--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] @echo -off doesn't work in a script

2013-02-12 Thread Jarlstrom, Laurie
I just tried the attached scripts on the UDK2010.SR1.UP1 Nt32 emulation and the 
shell echo worked as per the screen capture attached
Try the scripts attached.


thanks,
Laurie
 
laurie.jarlst...@intel.com
EFI / Framework Technical 
Marketing Engineering Team
(503) 712-9395
-Original Message-
From: Stephen Polkowski [mailto:step...@centtech.com] 
Sent: Tuesday, February 12, 2013 9:19 AM
To: edk2-devel@lists.sourceforge.net
Subject: [edk2] @echo -off doesn't work in a script

Hi all,

Shouldn't @echo -off work in a .nsh script.  It doesn't on the latest 
UDK2010.SR1.UP1 shell.  It only hides the echo -off command.  The
commands that follow it are echoed to the screen.

Am I missing something.

Thanks in advance,

Stephen


--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Script2.nsh
Description: Script2.nsh


script1.nsh
Description: script1.nsh
attachment: UDK2010.SR1.UP1-script1.JPG--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] @echo -off doesn't work in a script

2013-02-12 Thread Tim Lewis
Laurie --

Is this a bug, then? Chapter 4 of the UEFI Shell spec says: Also, additional 
'@' before a command in a script file can prevent the current command from 
being echoed


-Original Message-
From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com] 
Sent: Tuesday, February 12, 2013 10:12 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

The results are different with UEFI Shell 2.0.  The initial @ needs to be 
removed for UEFI Shell 2.0.  

thanks,
Laurie
 
laurie.jarlst...@intel.com
EFI / Framework Technical
Marketing Engineering Team
(503) 712-9395

-Original Message-
From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
Sent: Tuesday, February 12, 2013 9:55 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

I just tried the attached scripts on the UDK2010.SR1.UP1 Nt32 emulation and the 
shell echo worked as per the screen capture attached Try the scripts attached.


thanks,
Laurie
 
laurie.jarlst...@intel.com
EFI / Framework Technical
Marketing Engineering Team
(503) 712-9395
-Original Message-
From: Stephen Polkowski [mailto:step...@centtech.com]
Sent: Tuesday, February 12, 2013 9:19 AM
To: edk2-devel@lists.sourceforge.net
Subject: [edk2] @echo -off doesn't work in a script

Hi all,

Shouldn't @echo -off work in a .nsh script.  It doesn't on the latest
UDK2010.SR1.UP1 shell.  It only hides the echo -off command.  The commands that 
follow it are echoed to the screen.

Am I missing something.

Thanks in advance,

Stephen


--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 and get the 
hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 and get the 
hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] @echo -off doesn't work in a script

2013-02-12 Thread Rothman, Michael A
This smells like a bug to me.  First line @ statements should work..

Thanks,
Mike Rothman 
(迈克 罗斯曼 / माइकल रोथ्मेन् / Михаил Ротман / משה רוטמן)
רק טיפשים חושבים שהם יכולים לעבוד עלי

-Original Message-
From: Tim Lewis [mailto:tim.le...@insyde.com] 
Sent: Tuesday, February 12, 2013 10:16 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Laurie --

Is this a bug, then? Chapter 4 of the UEFI Shell spec says: Also, additional 
'@' before a command in a script file can prevent the current command from 
being echoed


-Original Message-
From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com] 
Sent: Tuesday, February 12, 2013 10:12 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

The results are different with UEFI Shell 2.0.  The initial @ needs to be 
removed for UEFI Shell 2.0.  

thanks,
Laurie
 
laurie.jarlst...@intel.com
EFI / Framework Technical
Marketing Engineering Team
(503) 712-9395

-Original Message-
From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
Sent: Tuesday, February 12, 2013 9:55 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

I just tried the attached scripts on the UDK2010.SR1.UP1 Nt32 emulation and the 
shell echo worked as per the screen capture attached Try the scripts attached.


thanks,
Laurie
 
laurie.jarlst...@intel.com
EFI / Framework Technical
Marketing Engineering Team
(503) 712-9395
-Original Message-
From: Stephen Polkowski [mailto:step...@centtech.com]
Sent: Tuesday, February 12, 2013 9:19 AM
To: edk2-devel@lists.sourceforge.net
Subject: [edk2] @echo -off doesn't work in a script

Hi all,

Shouldn't @echo -off work in a .nsh script.  It doesn't on the latest
UDK2010.SR1.UP1 shell.  It only hides the echo -off command.  The commands that 
follow it are echoed to the screen.

Am I missing something.

Thanks in advance,

Stephen


--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 and get the 
hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 and get the 
hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel
--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] @echo -off doesn't work in a script

2013-02-12 Thread Carsey, Jaben
That does look wrong.  I would expect that it would not show the echo command 
line.
It shouldn't show:
2.0 FS0:\ echo Hello World

Have you looked at the code?  I don't remember how this works inside...

-Jaben

-Original Message-
From: Stephen Polkowski [mailto:step...@centtech.com] 
Sent: Tuesday, February 12, 2013 10:49 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Yes, that is my point.  There is no way to hide the echo -off command in 
the 2.0 shell.  If you use the @ with echo -off it will fail to 
disable echo for sub-sequent commands.

file:  hello.nsh

@echo -off
echo Hello World

output:

2.0 FS0:\ hello.nsh
2.0 FS0:\ echo Hello World
Hello World
2.0 FS0:\

Is this a feature?

Thanks,

Stephen

Tim Lewis wrote:
 Laurie --
 
 Is this a bug, then? Chapter 4 of the UEFI Shell spec says: Also, additional 
 '@' before a command in a script file can prevent the current command from 
 being echoed
 
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com] 
 Sent: Tuesday, February 12, 2013 10:12 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 The results are different with UEFI Shell 2.0.  The initial @ needs to be 
 removed for UEFI Shell 2.0.  
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
 Sent: Tuesday, February 12, 2013 9:55 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 I just tried the attached scripts on the UDK2010.SR1.UP1 Nt32 emulation and 
 the shell echo worked as per the screen capture attached Try the scripts 
 attached.
 
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 -Original Message-
 From: Stephen Polkowski [mailto:step...@centtech.com]
 Sent: Tuesday, February 12, 2013 9:19 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: [edk2] @echo -off doesn't work in a script
 
 Hi all,
 
 Shouldn't @echo -off work in a .nsh script.  It doesn't on the latest
 UDK2010.SR1.UP1 shell.  It only hides the echo -off command.  The commands 
 that follow it are echoed to the screen.
 
 Am I missing something.
 
 Thanks in advance,
 
 Stephen
 
 
 --
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get the 
 hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
 --
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get the 
 hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
 --
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 
 and get the hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/edk2-devel


-- 
Stephen Polkowski
Centaur Technology
Austin, TX
(512) 418-5730

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] @echo -off doesn't work in a script

2013-02-12 Thread Tim Lewis
The problem is in Shell.c: 

  if (CommandLine3[0] == L'@') {
PreCommandEchoState = ShellCommandGetEchoState();
ShellCommandSetEchoState(FALSE);
Status = RunCommand(CommandLine3+1);

//
// Now restore the pre-'@' echo state.
//
ShellCommandSetEchoState(PreCommandEchoState);
}

If the command is echo, it restores the state prior to the echo command. 


-Original Message-
From: Stephen Polkowski [mailto:step...@centtech.com] 
Sent: Tuesday, February 12, 2013 10:49 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Yes, that is my point.  There is no way to hide the echo -off command in the 
2.0 shell.  If you use the @ with echo -off it will fail to disable echo for 
sub-sequent commands.

file:  hello.nsh

@echo -off
echo Hello World

output:

2.0 FS0:\ hello.nsh
2.0 FS0:\ echo Hello World
Hello World
2.0 FS0:\

Is this a feature?

Thanks,

Stephen

Tim Lewis wrote:
 Laurie --
 
 Is this a bug, then? Chapter 4 of the UEFI Shell spec says: Also, additional 
 '@' before a command in a script file can prevent the current command from 
 being echoed
 
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
 Sent: Tuesday, February 12, 2013 10:12 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 The results are different with UEFI Shell 2.0.  The initial @ needs to be 
 removed for UEFI Shell 2.0.  
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
 Sent: Tuesday, February 12, 2013 9:55 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 I just tried the attached scripts on the UDK2010.SR1.UP1 Nt32 emulation and 
 the shell echo worked as per the screen capture attached Try the scripts 
 attached.
 
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 -Original Message-
 From: Stephen Polkowski [mailto:step...@centtech.com]
 Sent: Tuesday, February 12, 2013 9:19 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: [edk2] @echo -off doesn't work in a script
 
 Hi all,
 
 Shouldn't @echo -off work in a .nsh script.  It doesn't on the latest
 UDK2010.SR1.UP1 shell.  It only hides the echo -off command.  The commands 
 that follow it are echoed to the screen.
 
 Am I missing something.
 
 Thanks in advance,
 
 Stephen
 
 
 --
 
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get the 
 hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
 --
 
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get the 
 hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
 --
 
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get 
 the hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/edk2-devel


--
Stephen Polkowski
Centaur Technology
Austin, TX
(512) 418-5730

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 and get the 
hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] @echo -off doesn't work in a script

2013-02-12 Thread Carsey, Jaben
I think the restore there is designed to handle the case where the script calls 
another script with @

script1.nsh
@script2.nsh

I don't think that any other case requires the restoration of the echo state.

-Jaben

-Original Message-
From: Tim Lewis [mailto:tim.le...@insyde.com] 
Sent: Tuesday, February 12, 2013 10:57 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

The problem is in Shell.c: 

  if (CommandLine3[0] == L'@') {
PreCommandEchoState = ShellCommandGetEchoState();
ShellCommandSetEchoState(FALSE);
Status = RunCommand(CommandLine3+1);

//
// Now restore the pre-'@' echo state.
//
ShellCommandSetEchoState(PreCommandEchoState);
}

If the command is echo, it restores the state prior to the echo command. 


-Original Message-
From: Stephen Polkowski [mailto:step...@centtech.com]
Sent: Tuesday, February 12, 2013 10:49 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Yes, that is my point.  There is no way to hide the echo -off command in the 
2.0 shell.  If you use the @ with echo -off it will fail to disable echo for 
sub-sequent commands.

file:  hello.nsh

@echo -off
echo Hello World

output:

2.0 FS0:\ hello.nsh
2.0 FS0:\ echo Hello World
Hello World
2.0 FS0:\

Is this a feature?

Thanks,

Stephen

Tim Lewis wrote:
 Laurie --
 
 Is this a bug, then? Chapter 4 of the UEFI Shell spec says: Also, additional 
 '@' before a command in a script file can prevent the current command from 
 being echoed
 
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
 Sent: Tuesday, February 12, 2013 10:12 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 The results are different with UEFI Shell 2.0.  The initial @ needs to be 
 removed for UEFI Shell 2.0.  
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
 Sent: Tuesday, February 12, 2013 9:55 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 I just tried the attached scripts on the UDK2010.SR1.UP1 Nt32 emulation and 
 the shell echo worked as per the screen capture attached Try the scripts 
 attached.
 
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 -Original Message-
 From: Stephen Polkowski [mailto:step...@centtech.com]
 Sent: Tuesday, February 12, 2013 9:19 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: [edk2] @echo -off doesn't work in a script
 
 Hi all,
 
 Shouldn't @echo -off work in a .nsh script.  It doesn't on the latest
 UDK2010.SR1.UP1 shell.  It only hides the echo -off command.  The commands 
 that follow it are echoed to the screen.
 
 Am I missing something.
 
 Thanks in advance,
 
 Stephen
 
 
 --
 
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get the 
 hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
 --
 
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get the 
 hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
 --
 
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get 
 the hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/edk2-devel


--
Stephen Polkowski
Centaur Technology
Austin, TX
(512) 418-5730

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 and get the 
hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

--
Free Next-Gen Firewall Hardware Offer
Buy your

Re: [edk2] @echo -off doesn't work in a script

2013-02-12 Thread Rothman, Michael A
Tim, agreed.

Thanks,
Mike Rothman 
(迈克 罗斯曼 / माइकल रोथ्मेन् / Михаил Ротман / משה רוטמן)
רק טיפשים חושבים שהם יכולים לעבוד עלי


-Original Message-
From: Tim Lewis [mailto:tim.le...@insyde.com] 
Sent: Tuesday, February 12, 2013 11:12 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Jaben --

I thought the other case was

1. echo is on
2. @other-command turns off echo temporarily
3. echo is restored back on

Tim

-Original Message-
From: Carsey, Jaben [mailto:jaben.car...@intel.com] 
Sent: Tuesday, February 12, 2013 11:09 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

I think the restore there is designed to handle the case where the script calls 
another script with @

script1.nsh
@script2.nsh

I don't think that any other case requires the restoration of the echo state.

-Jaben

-Original Message-
From: Tim Lewis [mailto:tim.le...@insyde.com]
Sent: Tuesday, February 12, 2013 10:57 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

The problem is in Shell.c: 

  if (CommandLine3[0] == L'@') {
PreCommandEchoState = ShellCommandGetEchoState();
ShellCommandSetEchoState(FALSE);
Status = RunCommand(CommandLine3+1);

//
// Now restore the pre-'@' echo state.
//
ShellCommandSetEchoState(PreCommandEchoState);
}

If the command is echo, it restores the state prior to the echo command. 


-Original Message-
From: Stephen Polkowski [mailto:step...@centtech.com]
Sent: Tuesday, February 12, 2013 10:49 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Yes, that is my point.  There is no way to hide the echo -off command in the 
2.0 shell.  If you use the @ with echo -off it will fail to disable echo for 
sub-sequent commands.

file:  hello.nsh

@echo -off
echo Hello World

output:

2.0 FS0:\ hello.nsh
2.0 FS0:\ echo Hello World
Hello World
2.0 FS0:\

Is this a feature?

Thanks,

Stephen

Tim Lewis wrote:
 Laurie --
 
 Is this a bug, then? Chapter 4 of the UEFI Shell spec says: Also, additional 
 '@' before a command in a script file can prevent the current command from 
 being echoed
 
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
 Sent: Tuesday, February 12, 2013 10:12 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 The results are different with UEFI Shell 2.0.  The initial @ needs to be 
 removed for UEFI Shell 2.0.  
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
 Sent: Tuesday, February 12, 2013 9:55 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 I just tried the attached scripts on the UDK2010.SR1.UP1 Nt32 emulation and 
 the shell echo worked as per the screen capture attached Try the scripts 
 attached.
 
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 -Original Message-
 From: Stephen Polkowski [mailto:step...@centtech.com]
 Sent: Tuesday, February 12, 2013 9:19 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: [edk2] @echo -off doesn't work in a script
 
 Hi all,
 
 Shouldn't @echo -off work in a .nsh script.  It doesn't on the latest
 UDK2010.SR1.UP1 shell.  It only hides the echo -off command.  The commands 
 that follow it are echoed to the screen.
 
 Am I missing something.
 
 Thanks in advance,
 
 Stephen
 
 
 --
 
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get the 
 hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
 --
 
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get the 
 hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
 --
 
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get 
 the hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel

Re: [edk2] @echo -off doesn't work in a script

2013-02-12 Thread Carsey, Jaben
But since the only checking of the echo state happens in the else statement of 
the if that we are already inside of. We could just ignore it entirely since we 
inherently skipped the printout.   When I say ignore it, I mean ignore both 
the set to FALSE, and the restore.  

But since this entire function gets called again with a new script file, we 
need to set the global setting.

  if (CommandLine3[0] == L'@') {
//
// We need to save the current echo state
// and disable echo for just this command.
//
PreCommandEchoState = ShellCommandGetEchoState();
ShellCommandSetEchoState(FALSE);
Status = RunCommand(CommandLine3+1);

//
// Now restore the pre-'@' echo state.
//
ShellCommandSetEchoState(PreCommandEchoState);
  } else {
if (ShellCommandGetEchoState()) {
  CurDir = ShellInfoObject.NewEfiShellProtocol-GetEnv(Lcwd);
  if (CurDir != NULL  StrLen(CurDir)  1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_CURDIR), 
ShellInfoObject.HiiHandle, CurDir);
  } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_SHELL), 
ShellInfoObject.HiiHandle);
  }
  ShellPrintEx(-1, -1, L%s\r\n, CommandLine2);
}
Status = RunCommand(CommandLine3);
  }

-Original Message-
From: Tim Lewis [mailto:tim.le...@insyde.com] 
Sent: Tuesday, February 12, 2013 11:12 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Jaben --

I thought the other case was

1. echo is on
2. @other-command turns off echo temporarily 3. echo is restored back on

Tim

-Original Message-
From: Carsey, Jaben [mailto:jaben.car...@intel.com]
Sent: Tuesday, February 12, 2013 11:09 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

I think the restore there is designed to handle the case where the script calls 
another script with @

script1.nsh
@script2.nsh

I don't think that any other case requires the restoration of the echo state.

-Jaben

-Original Message-
From: Tim Lewis [mailto:tim.le...@insyde.com]
Sent: Tuesday, February 12, 2013 10:57 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

The problem is in Shell.c: 

  if (CommandLine3[0] == L'@') {
PreCommandEchoState = ShellCommandGetEchoState();
ShellCommandSetEchoState(FALSE);
Status = RunCommand(CommandLine3+1);

//
// Now restore the pre-'@' echo state.
//
ShellCommandSetEchoState(PreCommandEchoState);
}

If the command is echo, it restores the state prior to the echo command. 


-Original Message-
From: Stephen Polkowski [mailto:step...@centtech.com]
Sent: Tuesday, February 12, 2013 10:49 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Yes, that is my point.  There is no way to hide the echo -off command in the 
2.0 shell.  If you use the @ with echo -off it will fail to disable echo for 
sub-sequent commands.

file:  hello.nsh

@echo -off
echo Hello World

output:

2.0 FS0:\ hello.nsh
2.0 FS0:\ echo Hello World
Hello World
2.0 FS0:\

Is this a feature?

Thanks,

Stephen

Tim Lewis wrote:
 Laurie --
 
 Is this a bug, then? Chapter 4 of the UEFI Shell spec says: Also, additional 
 '@' before a command in a script file can prevent the current command from 
 being echoed
 
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
 Sent: Tuesday, February 12, 2013 10:12 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 The results are different with UEFI Shell 2.0.  The initial @ needs to be 
 removed for UEFI Shell 2.0.  
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
 Sent: Tuesday, February 12, 2013 9:55 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 I just tried the attached scripts on the UDK2010.SR1.UP1 Nt32 emulation and 
 the shell echo worked as per the screen capture attached Try the scripts 
 attached.
 
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 -Original Message-
 From: Stephen Polkowski [mailto:step...@centtech.com]
 Sent: Tuesday, February 12, 2013 9:19 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: [edk2] @echo -off doesn't work in a script
 
 Hi all,
 
 Shouldn't @echo -off work in a .nsh script.  It doesn't on the latest
 UDK2010.SR1.UP1 shell.  It only hides the echo -off command.  The commands

Re: [edk2] @echo -off doesn't work in a script

2013-02-12 Thread Carsey, Jaben
I disagree.  The @ only turns echo off.  It is not a temporary reversal of the 
current state.

Per your quote Also, additional '@' before a command in a script file can 
prevent the current command from being echoed


-Original Message-
From: Rothman, Michael A [mailto:michael.a.roth...@intel.com] 
Sent: Tuesday, February 12, 2013 11:16 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Tim, agreed.

Thanks,
Mike Rothman
(迈克 罗斯曼 / माइकल रोथ्मेन् / Михаил Ротман / משה רוטמן) רק טיפשים חושבים שהם 
יכולים לעבוד עלי


-Original Message-
From: Tim Lewis [mailto:tim.le...@insyde.com] 
Sent: Tuesday, February 12, 2013 11:12 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Jaben --

I thought the other case was

1. echo is on
2. @other-command turns off echo temporarily
3. echo is restored back on

Tim

-Original Message-
From: Carsey, Jaben [mailto:jaben.car...@intel.com] 
Sent: Tuesday, February 12, 2013 11:09 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

I think the restore there is designed to handle the case where the script calls 
another script with @

script1.nsh
@script2.nsh

I don't think that any other case requires the restoration of the echo state.

-Jaben

-Original Message-
From: Tim Lewis [mailto:tim.le...@insyde.com]
Sent: Tuesday, February 12, 2013 10:57 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

The problem is in Shell.c: 

  if (CommandLine3[0] == L'@') {
PreCommandEchoState = ShellCommandGetEchoState();
ShellCommandSetEchoState(FALSE);
Status = RunCommand(CommandLine3+1);

//
// Now restore the pre-'@' echo state.
//
ShellCommandSetEchoState(PreCommandEchoState);
}

If the command is echo, it restores the state prior to the echo command. 


-Original Message-
From: Stephen Polkowski [mailto:step...@centtech.com]
Sent: Tuesday, February 12, 2013 10:49 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Yes, that is my point.  There is no way to hide the echo -off command in the 
2.0 shell.  If you use the @ with echo -off it will fail to disable echo for 
sub-sequent commands.

file:  hello.nsh

@echo -off
echo Hello World

output:

2.0 FS0:\ hello.nsh
2.0 FS0:\ echo Hello World
Hello World
2.0 FS0:\

Is this a feature?

Thanks,

Stephen

Tim Lewis wrote:
 Laurie --
 
 Is this a bug, then? Chapter 4 of the UEFI Shell spec says: Also, additional 
 '@' before a command in a script file can prevent the current command from 
 being echoed
 
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
 Sent: Tuesday, February 12, 2013 10:12 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 The results are different with UEFI Shell 2.0.  The initial @ needs to be 
 removed for UEFI Shell 2.0.  
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
 Sent: Tuesday, February 12, 2013 9:55 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 I just tried the attached scripts on the UDK2010.SR1.UP1 Nt32 emulation and 
 the shell echo worked as per the screen capture attached Try the scripts 
 attached.
 
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 -Original Message-
 From: Stephen Polkowski [mailto:step...@centtech.com]
 Sent: Tuesday, February 12, 2013 9:19 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: [edk2] @echo -off doesn't work in a script
 
 Hi all,
 
 Shouldn't @echo -off work in a .nsh script.  It doesn't on the latest
 UDK2010.SR1.UP1 shell.  It only hides the echo -off command.  The commands 
 that follow it are echoed to the screen.
 
 Am I missing something.
 
 Thanks in advance,
 
 Stephen
 
 
 --
 
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get the 
 hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
 --
 
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get the 
 hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list

Re: [edk2] @echo -off doesn't work in a script

2013-02-12 Thread Tim Lewis
Jaben -- I think we're actually agreeing. I understand that @ temporarily turns 
echo off.  The only case where this fails is where the other-command changes 
the echo state itself.

Tim

-Original Message-
From: Carsey, Jaben [mailto:jaben.car...@intel.com] 
Sent: Tuesday, February 12, 2013 11:20 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

I disagree.  The @ only turns echo off.  It is not a temporary reversal of the 
current state.

Per your quote Also, additional '@' before a command in a script file can 
prevent the current command from being echoed


-Original Message-
From: Rothman, Michael A [mailto:michael.a.roth...@intel.com]
Sent: Tuesday, February 12, 2013 11:16 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Tim, agreed.

Thanks,
Mike Rothman
(迈克 罗斯曼 / माइकल रोथ्मेन् / Михаил Ротман / משה רוטמן) רק טיפשים חושבים שהם 
יכולים לעבוד עלי


-Original Message-
From: Tim Lewis [mailto:tim.le...@insyde.com]
Sent: Tuesday, February 12, 2013 11:12 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Jaben --

I thought the other case was

1. echo is on
2. @other-command turns off echo temporarily 3. echo is restored back on

Tim

-Original Message-
From: Carsey, Jaben [mailto:jaben.car...@intel.com]
Sent: Tuesday, February 12, 2013 11:09 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

I think the restore there is designed to handle the case where the script calls 
another script with @

script1.nsh
@script2.nsh

I don't think that any other case requires the restoration of the echo state.

-Jaben

-Original Message-
From: Tim Lewis [mailto:tim.le...@insyde.com]
Sent: Tuesday, February 12, 2013 10:57 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

The problem is in Shell.c: 

  if (CommandLine3[0] == L'@') {
PreCommandEchoState = ShellCommandGetEchoState();
ShellCommandSetEchoState(FALSE);
Status = RunCommand(CommandLine3+1);

//
// Now restore the pre-'@' echo state.
//
ShellCommandSetEchoState(PreCommandEchoState);
}

If the command is echo, it restores the state prior to the echo command. 


-Original Message-
From: Stephen Polkowski [mailto:step...@centtech.com]
Sent: Tuesday, February 12, 2013 10:49 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] @echo -off doesn't work in a script

Yes, that is my point.  There is no way to hide the echo -off command in the 
2.0 shell.  If you use the @ with echo -off it will fail to disable echo for 
sub-sequent commands.

file:  hello.nsh

@echo -off
echo Hello World

output:

2.0 FS0:\ hello.nsh
2.0 FS0:\ echo Hello World
Hello World
2.0 FS0:\

Is this a feature?

Thanks,

Stephen

Tim Lewis wrote:
 Laurie --
 
 Is this a bug, then? Chapter 4 of the UEFI Shell spec says: Also, additional 
 '@' before a command in a script file can prevent the current command from 
 being echoed
 
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
 Sent: Tuesday, February 12, 2013 10:12 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 The results are different with UEFI Shell 2.0.  The initial @ needs to be 
 removed for UEFI Shell 2.0.  
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 
 -Original Message-
 From: Jarlstrom, Laurie [mailto:laurie.jarlst...@intel.com]
 Sent: Tuesday, February 12, 2013 9:55 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: Re: [edk2] @echo -off doesn't work in a script
 
 I just tried the attached scripts on the UDK2010.SR1.UP1 Nt32 emulation and 
 the shell echo worked as per the screen capture attached Try the scripts 
 attached.
 
 
 thanks,
 Laurie
  
 laurie.jarlst...@intel.com
 EFI / Framework Technical
 Marketing Engineering Team
 (503) 712-9395
 -Original Message-
 From: Stephen Polkowski [mailto:step...@centtech.com]
 Sent: Tuesday, February 12, 2013 9:19 AM
 To: edk2-devel@lists.sourceforge.net
 Subject: [edk2] @echo -off doesn't work in a script
 
 Hi all,
 
 Shouldn't @echo -off work in a .nsh script.  It doesn't on the latest
 UDK2010.SR1.UP1 shell.  It only hides the echo -off command.  The commands 
 that follow it are echoed to the screen.
 
 Am I missing something.
 
 Thanks in advance,
 
 Stephen
 
 
 --
 
 Free Next-Gen Firewall Hardware Offer
 Buy your Sophos next-gen firewall before the end March 2013 and get the 
 hardware for free! Learn more.
 http://p.sf.net/sfu/sophos-d2d-feb
 ___
 edk2-devel mailing list
 edk2-devel@lists.sourceforge.net