From 848997b59a5316167bfe3d3cb3671ca3b0baf9af Mon Sep 17 00:00:00 2001 From: jcarsey Date: Tue, 9 Aug 2011 16:33:58 +0000 Subject: [PATCH] This adds support for @ prefixed commands in script files. signed-off-by: jcarsey reviewed-by: geekboy15a git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12113 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Application/Shell/Shell.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c index 452c65588b..e817a11142 100644 --- a/ShellPkg/Application/Shell/Shell.c +++ b/ShellPkg/Application/Shell/Shell.c @@ -1619,6 +1619,7 @@ RunScriptFileHandle ( SCRIPT_COMMAND_LIST *LastCommand; BOOLEAN Ascii; BOOLEAN PreScriptEchoState; + BOOLEAN PreCommandEchoState; CONST CHAR16 *CurDir; UINTN LineCount; @@ -1806,7 +1807,22 @@ RunScriptFileHandle ( } ShellPrintEx(-1, -1, L"%s\r\n", CommandLine2); } - Status = RunCommand(CommandLine3); + 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 { + Status = RunCommand(CommandLine3); + } } if (ShellCommandGetScriptExit()) { -- 2.39.2