lkml.org 
[lkml]   [1997]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: pre-2.0.31-7 nit picks
    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 |
    > `----------------------------------------------------------------------'
    >


    \
     
     \ /
      Last update: 2005-03-22 13:40    [W:0.019 / U:29.928 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site