From 52a27cf0cc525e9fd1fab0ca95a60cc64d79b8fc Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Thu, 25 Jan 2024 18:22:25 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20remove=20unnecessary=20file=20descr?= =?UTF-8?q?iptor=20`1`=20in=20redirect=20=E2=9E=A1=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cp-into-docker-run | 4 ++-- bin/show-busy-java-threads | 2 +- bin/uq | 4 ++-- legacy-bin/cp-svn-url | 2 +- test-cases/bump-scripts-version.sh | 2 +- test-cases/my_unit_test_lib.sh | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/cp-into-docker-run b/bin/cp-into-docker-run index c5a0d4e2..6d1aff02 100755 --- a/bin/cp-into-docker-run +++ b/bin/cp-into-docker-run @@ -29,7 +29,7 @@ redPrint() { } die() { - redPrint "Error: $*" 1>&2 + redPrint "Error: $*" >&2 exit 1 } @@ -242,7 +242,7 @@ trap cleanupWhenExit EXIT ######################################## logAndRun() { - $verbose && printf '%s\n' "[$PROG] $*" 1>&2 + $verbose && printf '%s\n' "[$PROG] $*" >&2 "$@" } diff --git a/bin/show-busy-java-threads b/bin/show-busy-java-threads index 27f056ea..8097444c 100755 --- a/bin/show-busy-java-threads +++ b/bin/show-busy-java-threads @@ -101,7 +101,7 @@ blueOutput() { } die() { - redOutput "Error: $*" 1>&2 + redOutput "Error: $*" >&2 exit 1 } diff --git a/bin/uq b/bin/uq index d05d62b2..fb181613 100755 --- a/bin/uq +++ b/bin/uq @@ -9,7 +9,7 @@ # # @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-uq # @author Zava Xu (zava.kid at gmail dot com) -# @author Jerry Lee (oldratlee at gmail dot com)# NOTE about Bash Traps and Pitfalls: +# @author Jerry Lee (oldratlee at gmail dot com) # # NOTE about Bash Traps and Pitfalls: # @@ -60,7 +60,7 @@ yellowPrint() { } die() { - redPrint "Error: $*" 1>&2 + redPrint "Error: $*" >&2 exit 1 } diff --git a/legacy-bin/cp-svn-url b/legacy-bin/cp-svn-url index 970147b5..0866c4ed 100755 --- a/legacy-bin/cp-svn-url +++ b/legacy-bin/cp-svn-url @@ -78,7 +78,7 @@ readonly dir="${1:-.}" # NOTE: DO NOT declare var url as readonly in ONE line! url="$(svn info "${dir}" | awk '/^URL: /{print $2}')" if [ -z "${url}" ]; then - echo "Fail to get svn url!" 1>&2 + echo "Fail to get svn url!" >&2 exit 1 fi diff --git a/test-cases/bump-scripts-version.sh b/test-cases/bump-scripts-version.sh index 118d1f1f..32ab7568 100755 --- a/test-cases/bump-scripts-version.sh +++ b/test-cases/bump-scripts-version.sh @@ -49,7 +49,7 @@ logAndRun() { } die() { - redPrint "Error: $*" 1>&2 + redPrint "Error: $*" >&2 exit 1 } diff --git a/test-cases/my_unit_test_lib.sh b/test-cases/my_unit_test_lib.sh index fe0c6c78..907c1e20 100644 --- a/test-cases/my_unit_test_lib.sh +++ b/test-cases/my_unit_test_lib.sh @@ -40,7 +40,7 @@ fail() { } die() { - redEcho "Error: $*" 1>&2 + redEcho "Error: $*" >&2 exit 1 }