awk refactor of my scripts
awk is OP man - so easy to use and does a bunch of stuff all at once without having to rely on multiple pipes. It comes with essentially every distribution so you'll always have access to it.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
echo "㊋ $(sensors | grep "Tctl" | sed 's/Tctl:.*+\(.*\)C.*/\1/')C"
|
||||
data=$(sensors | awk -F'+' '/Tctl/ { gsub(/[ \t]+$/, "", $2); print $2 }')
|
||||
echo "㊋ $data"
|
||||
|
||||
Reference in New Issue
Block a user