Q: Grab last line of 'cat' output without head, tail, sed or awk I have a directory of files on an (older) Android device and want to cat the file that comes last in the file listing when I call ls. Now on my Linux computer I'd have no problem with that, I could just do
ls | tail -n 1

But on my phone, neither tail, nor head, sed, or awk are available. So what should I do?

A: Try:
for a in *; do :; done; echo "$a"

