Skip to content

Commit

Permalink
refactor: remove unnecessary file descriptor 1 in redirect ➡️
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Jan 25, 2024
1 parent 88d0d09 commit 52a27cf
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions bin/cp-into-docker-run
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ redPrint() {
}

die() {
redPrint "Error: $*" 1>&2
redPrint "Error: $*" >&2
exit 1
}

Expand Down Expand Up @@ -242,7 +242,7 @@ trap cleanupWhenExit EXIT
########################################

logAndRun() {
$verbose && printf '%s\n' "[$PROG] $*" 1>&2
$verbose && printf '%s\n' "[$PROG] $*" >&2
"$@"
}

Expand Down
2 changes: 1 addition & 1 deletion bin/show-busy-java-threads
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ blueOutput() {
}

die() {
redOutput "Error: $*" 1>&2
redOutput "Error: $*" >&2
exit 1
}

Expand Down
4 changes: 2 additions & 2 deletions bin/uq
Original file line number Diff line number Diff line change
Expand Up @@ -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:
#
Expand Down Expand Up @@ -60,7 +60,7 @@ yellowPrint() {
}

die() {
redPrint "Error: $*" 1>&2
redPrint "Error: $*" >&2
exit 1
}

Expand Down
2 changes: 1 addition & 1 deletion legacy-bin/cp-svn-url
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test-cases/bump-scripts-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ logAndRun() {
}

die() {
redPrint "Error: $*" 1>&2
redPrint "Error: $*" >&2
exit 1
}

Expand Down
2 changes: 1 addition & 1 deletion test-cases/my_unit_test_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fail() {
}

die() {
redEcho "Error: $*" 1>&2
redEcho "Error: $*" >&2
exit 1
}

Expand Down

0 comments on commit 52a27cf

Please sign in to comment.