Shell How get tail command from variable in script file

Hi, please help me.
How get string line use tail command from variable in shell script file.
For example:
Code:
#!/bin/sh
a=`timeout 60 tail -f /var/log/mpd.log | grep "Device not configured"`
b=`tail -n 1 $a`   #this string is error because "$a" not file!
 
I'm sure there are tons of better ways to do this:
Code:
b=`echo $a | tail -n 1`
 
Back
Top