#!/bin/sh perc=$(awk -F"[][]" '/Front Left/ { print $2 }' <(amixer sget Master) | tail -n +2) case $(awk -F"[][]" '/Front Left/ { print $4 }' <(amixer sget Master) | tail -n +2) in "on") echo "$perc/1" ;; "off") echo "$perc/0" ;; esac