What I get:
host:~ user$ cat example.txt some texthost:~ stas$
What I want to get:
host:~ user$ cat example.txt some text host:~ stas$
Is there a way I can make
cat behave like this?
I'm using bash on Mac OS X.
Most unix tools are designed to work well with text files. A text file consists of a sequence of lines. A line consists of a sequence of printable characters ending with a newline character. In particular, the last character of a non-empty text file is always a newline character. Evidently,
You can make the bash display its prompt on the next line if the previous command left the cursor somewhere other than the last margin. Put this in your
The problem with that could be that your example.txt does not have a newline at the end of your file.
If you insist on using
You can turn it into a function with a name of your choice (even