Skip to content

Commit 397b631

Browse files
authored
Remove unnecessary use of awk (#422)
1 parent 62c4877 commit 397b631

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

segments/cpu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ run_segment() {
1515
fi
1616

1717
if [ -n "$cpu_user" ] && [ -n "$cpu_system" ] && [ -n "$cpu_idle" ]; then
18-
echo "${cpu_user}, ${cpu_system}, ${cpu_idle}" | awk -F', ' '{printf("%5.1f,%5.1f,%5.1f",$1,$2,$3)}'
18+
printf "%5.1f, %5.1f, %5.1f" "${cpu_user}" "${cpu_system}" "${cpu_idle}"
1919
return 0
2020
else
2121
return 1

0 commit comments

Comments
 (0)