когда научился комбинировать регулярки в sed

This commit is contained in:
паша душный 2023-05-03 19:17:46 +03:00
parent 3aa0589574
commit 50d457c9e6

View File

@ -7,7 +7,7 @@ then
echo "Charging" echo "Charging"
exit 0 exit 0
fi fi
bat=$(acpi -b | cut -b 25-27 | sed 's/%//') bat=$(acpi -b | sed 's#.*charging, ##;s#%.*##')
echo "$bat %" echo "$bat %"
if [[ "$bat" = 100 ]] if [[ "$bat" = 100 ]]
then then