jmc1024
July 22nd, 2007, 12:12 AM
I'm trying to write a script to toggle sound on and off. How do I escape the braces in the grep command so that they are part of the search pattern?
amixer get 'Master' | grep [on]
if [ 0 -e $? ];
then
amixer set 'Master',0 mute
else
amixer set 'Master',0 unmute
fi
I guess I could send amixer's output to /tmp/trash and then grep that, but I hate generating trash if I don't have to.
Thanks,
Mark
amixer get 'Master' | grep [on]
if [ 0 -e $? ];
then
amixer set 'Master',0 mute
else
amixer set 'Master',0 unmute
fi
I guess I could send amixer's output to /tmp/trash and then grep that, but I hate generating trash if I don't have to.
Thanks,
Mark