On Sat, Jul 24, 2010 at 10:23 AM, Andreas Schwab <sch...@linux-m68k.org> wrote: > koe...@science-computing.de writes: > >> empty line(s) at the end of quoted command subsitutions are missing: > > That is not a bug, but a feature. Command subsitution generally strips > trailing newlines from the output of the command. If you want the > complete output use a pipe. >
It's probably intuitively what you expect when you do var=$(echo a); echo "$var" In this case most people would expect 1 newline and not 2 (one from the first echo in $( ) and the second from the second echo) You can also use a trick like: var=$(command;printf e) var=${var%e}