Re: pre-2.0.31-7 nit picks

Rob Hagopian (hagopiar@vuser.vu.union.edu)
Fri, 22 Aug 1997 14:04:42 -0400 (EDT)


But without a \c or a -n echo will put a newline on there for you...
(although it might be in two write() statements I guess) Another cevat, I
discovered while piping commands to a VMS box through a telnet session
that it didn't like \n, just \r... I don't know how /proc deals with
linefeed/carriage return, but I had to use:
echo -n -e "xxxxxx\r"
-Rob H.

On Fri, 22 Aug 1997, Mike Jagdis wrote:

> On Thu, 21 Aug 1997, James Mastros wrote:
>
> > > $ strace bash -c 'echo "123 456 789"'
> > > execve("/bin/bash", ["bash", "-c", "echo \"123 456 789\""], [/* 28 vars */])
> > > write(1, "123 456 789", 11123 456 789) = 11
> > > write(1, "\n", 1
> > >
> >
> > But both put all the numbers in one write, so they should both be fine.
>
> The best way of doing the echo is:
>
> echo -e "xxxxx\n\c"
>
> Sometimes the newline in the write is important. For instance,
> /proc/sys/kernel/hostname. Just say what you mean instead of relying
> on obscure and loosely specified behaviour.
>
> Mike
>
> --
> .----------------------------------------------------------------------.
> | Mike Jagdis | Internet: mailto:mike@roan.co.uk |
> | Roan Technology Ltd. | |
> | 54A Peach Street, Wokingham | Telephone: +44 118 989 0403 |
> | RG40 1XG, ENGLAND | Fax: +44 118 989 1195 |
> `----------------------------------------------------------------------'
>