Skip to content

Commit

Permalink
Fix: "$_" does not expand as expected on Ubuntu
Browse files Browse the repository at this point in the history
While using Ubuntu as default builder nodes.
The .bashrc file does not process '$_' expanding
the output correctly as provided in previous line.
Therefore explicitly use the dirname or use /bin/bash.

This results in a copy error.

This happens is because by default Ubuntu "/bin/sh"
points to "/bin/dash" while on CentOS / RedHat points to
"/bin/bash".

Issue: RELENG-5666
Change-Id: Ibb4e0daeaf9730464451e229289b687aa2fb5389
Signed-off-by: Anil Belur <[email protected]>
  • Loading branch information
askb committed Jan 8, 2025
1 parent 4eb9ea0 commit 8b4402e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
issues:
- |
"$_" does not expand as expected on Ubuntu
While using Ubuntu as default builder nodes.
The .bashrc file does not process '$_' expanding
the output correctly as provided in previous line.
Therefore explicitly use the dirname or use /bin/bash.
This results in an copy error.
This happens is because by default Ubuntu "/bin/sh"
points to "/bin/dash" while on CentOS / RedHat points to
"/bin/bash".
2 changes: 1 addition & 1 deletion shell/sysstat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ esac

SAR_DIR="$WORKSPACE/archives/sar-reports"
mkdir -p "$SAR_DIR"
cp "$SYSSTAT_PATH/"* "$_"
cp "$SYSSTAT_PATH/"* "$SAR_DIR"
# convert sar data to ascii format
while IFS="" read -r sarfilenum; do
[ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}"
Expand Down

0 comments on commit 8b4402e

Please sign in to comment.