How do you use tail to get the last line outputted by a program. I've tried the following so far:
echo `cmd` >> stdin && tail -1 stdin
henry@henry-pc:~$ echo "abc\n123" >> stdin && tail -1 stdin abc\n123
You do not have to specify
You would want do to something like:
This will print
here n implies number of lines the user needs to be tailed.
so for your need,