Linux tail only whole words
- by Andrew
Hello, I need to print last 20 characters of string, but only whole words. Delimiter is a space "". Let's consider this example:
string="The quick brown fox jumps over the lazy dog"
echo $string | tail -c20
returns s over the lazy dog. And I need it to return over the lazy dog instead. Do you know how to accomplish that? Thanks!