I\'m trying to create a macro for Keyboard Maestro for OS X doing the following:
Since you're already using pipes, just throw another one in there:
ls -t | head -n1 |awk '{printf("newest file: %s",$0)}'
(Note that the "printf" does not include a '\n' at the end; that gets rid of the linebreak)
Edit:
With Arkku's suggestion to exit awk after the first line, it looks like:
ls -t | awk '{printf("newest file: %s",$0);exit}'