public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v4 1/6] edksetup.sh: Use bash variable $PWD instead of executing pwd command
@ 2019-07-16 16:55 rebecca
  2019-07-16 16:55 ` [PATCH v4 2/6] edksetup.sh: Use $SCRIPTNAME consistently instead of 'edksetup.sh' rebecca
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: rebecca @ 2019-07-16 16:55 UTC (permalink / raw)
  To: devel, lersek, bob.c.feng, liming.gao, michael.d.kinney, afish,
	zhijux.fan, leif.lindholm
  Cc: Rebecca Cran

This is a (very minor) optimization: `pwd` runs the command (even as a
built-in), whereas $PWD simply evaluates the value of the variable.

ALso, modern scripts should generally use $(...) to run commands,
instead of `...`.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
---
 edksetup.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/edksetup.sh b/edksetup.sh
index 12a3e26a67..ab58fe4a6e 100755
--- a/edksetup.sh
+++ b/edksetup.sh
@@ -71,7 +71,7 @@ function SetWorkspace()
   #
   # Set $WORKSPACE
   #
-  export WORKSPACE=`pwd`
+  export WORKSPACE=$PWD
   return 0
 }
 
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-07-23  8:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-16 16:55 [PATCH v4 1/6] edksetup.sh: Use bash variable $PWD instead of executing pwd command rebecca
2019-07-16 16:55 ` [PATCH v4 2/6] edksetup.sh: Use $SCRIPTNAME consistently instead of 'edksetup.sh' rebecca
2019-07-16 16:55 ` [PATCH v4 3/6] edksetup.sh: when executing arithmetic commands, $ isn't needed rebecca
2019-07-16 16:55 ` [PATCH v4 4/6] edksetup.sh: remove redundant -?, -h and --help in options parsing rebecca
2019-07-16 16:55 ` [PATCH v4 5/6] edksetup.sh: Simplify SetupPython3 and SetupPython functions rebecca
2019-07-16 18:48   ` Laszlo Ersek
2019-07-16 16:55 ` [PATCH v4 6/6] edksetup.sh: Add quotes and explicit checks in test statements rebecca
2019-07-17  2:56 ` [PATCH v4 1/6] edksetup.sh: Use bash variable $PWD instead of executing pwd command Liming Gao
2019-07-22 22:16 ` [edk2-devel] " Laszlo Ersek
2019-07-22 22:52   ` rebecca
2019-07-23  8:51     ` Laszlo Ersek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox