Skip to content
This repository has been archived by the owner on Feb 14, 2020. It is now read-only.

It seems that archey expects system awk but system sed #72

Open
CarterLi opened this issue Sep 10, 2017 · 0 comments
Open

It seems that archey expects system awk but system sed #72

CarterLi opened this issue Sep 10, 2017 · 0 comments

Comments

@CarterLi
Copy link

CarterLi commented Sep 10, 2017

I have both brewed gawk & gnu-sed installed.

ioreg -c AppleSmartBattery -r | awk '$1~/Capacity/{c[$1]=$3} END{OFMT="%.2f%"; max=c["\"MaxCapacity\""]; if (max>0) { print 100*c["\"CurrentCapacity\""]/max;} }'

prints 95.67%, which results in Battery: 95.67%%.

I try to fix this problem with

env PATH='/sbin:/usr/sbin/:/bin:/usr/bin' /usr/local/bin/archey

But it breaks uptime

env PATH='/bin:/usr/bin' bash -c "uptime 2> /dev/null | sed -e 's/.*up\s*//' -e 's/,\s*[0-9]* user.*//'"

prints 12:29, 6 users, load averages: 1.46 1.48 1.47, which results in Uptime: 12:36, 6 users, load averages: 1.33 1.43 1.46

@CarterLi CarterLi changed the title It strange that archey expects gnu-sed but system awk It seems that archey expects gnu-sed but system awk Sep 10, 2017
@CarterLi CarterLi changed the title It seems that archey expects gnu-sed but system awk It seems that archey expects system awk but system sed Sep 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant