You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reading error for CPU usage on SunOS. On prompt creation, bash will spit an error: bash: local: 33,/28: syntax error: operand expected (error token is "/28")
After turning on debug, I was able to trace the error to line 1484, which is doing division on the variable lp_cpu_load. This var is set in the function _lp_cpu_load, specificly at line 204. This runs uptime, and filters through awk.
Output: 4:51pm up 27 day(s), 5:41, 8 users, load average: 0.32, 0.35, 0.40
The problem is that the awk does not remove the comma after the first load number, creating the following command: 33,/28, which bash cannot evaluate with the comma in there.
I have no idea where this problem came from, as my versions of uptime have not changed, and as far as I can tell this version of the code has been running this way for a long time. Regardless, should be an straightforward fix to change the awk command to something smarter.
The text was updated successfully, but these errors were encountered:
Replacing the awk with this sed command fixes the problem (and removes one of the last two uses of awk from liquidprompt! ) sed 's/.*load average: *\([0-9.]*\).*/\1/'
Shell: bash
Operating system: SunOS
Liquid Prompt version (tag, commit): latest, 9c1c8a3
Reading error for CPU usage on SunOS. On prompt creation, bash will spit an error:
bash: local: 33,/28: syntax error: operand expected (error token is "/28")
After turning on debug, I was able to trace the error to line 1484, which is doing division on the variable
lp_cpu_load
. This var is set in the function_lp_cpu_load
, specificly at line 204. This runsuptime
, and filters through awk.Output:
4:51pm up 27 day(s), 5:41, 8 users, load average: 0.32, 0.35, 0.40
The problem is that the awk does not remove the comma after the first load number, creating the following command:
33,/28
, which bash cannot evaluate with the comma in there.I have no idea where this problem came from, as my versions of
uptime
have not changed, and as far as I can tell this version of the code has been running this way for a long time. Regardless, should be an straightforward fix to change the awk command to something smarter.The text was updated successfully, but these errors were encountered: