[9fans] bug in echo? - Plan9

This is a discussion on [9fans] bug in echo? - Plan9 ; > Who needs OpenOffice.org Base when you have PQ (which I have not tried)? Who needs an operating system when you have a 0 and a 1? Russ...

+ Reply to Thread
Page 3 of 3 FirstFirst 1 2 3
Results 41 to 60 of 60

Thread: [9fans] bug in echo?

  1. Re: [9fans] bug in echo?

    > Who needs OpenOffice.org Base when you have PQ (which I have not tried)?

    Who needs an operating system when you have a 0 and a 1?

    Russ



  2. Re: [9fans] bug in echo?

    roger peppe wrote:
    > personally, i'd vote for allowing -- just for
    > the above case: echoing unknown text.


    Exactly.

  3. Re: [9fans] bug in echo?

    > this is a very odd case which can be worked around without adding --.
    > the adding of which adds another odd case. what if you want to echo
    > --? so adding -- special case code doesn't really solve any problems.


    echo -- {whatever} # {whatever} can be "--", "-n", or other things

  4. Re: [9fans] bug in echo?

    Russ Cox wrote:
    > Who needs an operating system when you have a 0 and a 1?


    Actually all you need is one symbol.
    3(decimal) = |||
    7(decimal) = |||||||
    etc. Obviously this can express any numerically-coded object.

  5. Re: [9fans] bug in echo?

    Bruce Ellis wrote:
    > well the gcc list is still waiting for you ... maybe it was volatile.


    Is that a pointer to const volatile?

  6. Re: [9fans] bug in echo?

    hi, are you all student ? or have a job in a company ?
    why you have so many time in Plan9 ?
    Are all you spare all your spare time in Play9 ?



    On 4/1/08, Douglas A. Gwyn wrote:
    >
    > > this is a very odd case which can be worked around without adding --.
    > > the adding of which adds another odd case. what if you want to echo
    > > --? so adding -- special case code doesn't really solve any problems.

    >
    > echo -- {whatever} # {whatever} can be "--", "-n", or other things
    >
    >



  7. Re: [9fans] bug in echo?

    "Anders Li" wrote in message
    news:81975c3b0804010222y27b214ecgb4959b1cbc80ce71@ mail.gmail.com...
    > Are all you spare all your spare time in Play9 ?


    No, but all my base are belong to you.

  8. Re: [9fans] bug in echo?

    Actually I got concerned about other big problems with echo. It was
    pointed out on this list that this was confusing:

    whatever | echo 0 > /srv/whatever

    I mean, how can you pipe to echo? So I have a fixed version.

    Now, the sequence above will check fd 0 in the namespace. If it is a
    pipe, it will copy fd 0 to fd 1 until EOF, or the rent is due.

    Further, I added these patches to echo:
    abcdefghijklmnopqv

    v works as on cat. All other switches, see the texinfo.

    ron


  9. Re: [9fans] bug in echo?

    On Thu, Apr 3, 2008 at 6:46 PM, ron minnich wrote:
    >
    > Further, I added these patches to echo:
    > abcdefghijklmnopqv
    >
    > v works as on cat. All other switches, see the texinfo.
    >


    How are you going to call it smacmeecho ?.

    --
    - curiosity sKilled the cat


  10. Re: [9fans] bug in echo?

    * Gorka Guardiola (paurea@gmail.com) wrote:
    > How are you going to call it smacmeecho ?.


    smacho



  11. Re: [9fans] bug in echo?

    The ultimate echo, actually useful, but no one wants it.

    NAME
    echo: echo arguments
    SYNOPSIS
    echo [-1abCDEeilmNnOqrtuVvwXx] [-B base] [-c cmd] [-d char] [-f
    file] [-L len] [-o file] [-S voice] [-s char] [args...]
    DESCRIPTION
    echo outputs its arguments. It takes the following switches:

    -1 One argument per line.
    -a Output in ASCII. The default.
    -B base Output in given base, 2..32. Unless -u also given, base > 10
    shows lowercase.
    -b Output in binary.
    -C Don't echo anything, just print the number of fields.
    -c cmd Run cmd on each argument, replacing $? with the argument itself.
    -D Output in decimal.
    -d char Field delimiter. Default is end of argument.
    -E Print to standard error instead of to standard output.
    -e Allow escape sequences
    -f file Read from file, then from command line (if any).
    -i Read arguments from standard input.
    -L len Line width set to len. Default is to ignore line lengths.
    -l Turn uppercase to lowercase.
    -m Multi-column output.
    -N One field per line, numbering each field.
    -n Suppress newline.
    -O Output in octal.
    -o file Write to file instead of standard output.
    -q "Quiet mode:" redirect output to /dev/null if not to a file.
    -r Print every string that matches each regular expression. Regular
    expressions cannot contain + or * modifiers.
    -S voice Send to speaker, having the given voice say it. If voice is
    a null string, use the default voice.
    -s char Separate fields with char, default space.
    -t Separate fields with tabs.
    -u Convert lowercase to uppercase. With -B, output in uppercase
    letters for base > 10.
    -V Strip non-printing characters.
    -v Make non-printing characters visible.
    -w If -l is given, word wrap instead of character wrap. Otherwise,
    ignored.
    -X Output in uppercase hexadecimal.
    -x Output in lowercase hexadecimal.

    Test for everyone: write this echo in as little code as possible. C
    or rc is permitted. The rules:
    - for C: either Standard C (no other libraries) or only libc (no
    other Plan 9 libraries)
    - for rc: only use programs in the core Plan 9 distribution - no
    programs that I have to get myself
    - match the behavior EXACTLY as above
    - shortest code and fastest run time wins
    Winner gets something cool.



  12. Re: [9fans] bug in echo?

    Pietro Gagliardi wrote:
    > The ultimate echo, actually useful, but no one wants it.
    >
    > NAME
    > echo: echo arguments
    > SYNOPSIS
    > echo [-1abCDEeilmNnOqrtuVvwXx] [-B base] [-c cmd] [-d char] [-f
    > file] [-L len] [-o file] [-S voice] [-s char] [args...]
    > DESCRIPTION
    > echo outputs its arguments. It takes the following switches:
    >
    > -1 One argument per line.
    > -a Output in ASCII. The default.
    > -B base Output in given base, 2..32. Unless -u also given, base >
    > 10 shows lowercase.
    > -b Output in binary.
    > -C Don't echo anything, just print the number of fields.
    > -c cmd Run cmd on each argument, replacing $? with the argument
    > itself.
    > -D Output in decimal.
    > -d char Field delimiter. Default is end of argument.
    > -E Print to standard error instead of to standard output.
    > -e Allow escape sequences
    > -f file Read from file, then from command line (if any).
    > -i Read arguments from standard input.
    > -L len Line width set to len. Default is to ignore line lengths.
    > -l Turn uppercase to lowercase.
    > -m Multi-column output.
    > -N One field per line, numbering each field.
    > -n Suppress newline.
    > -O Output in octal.
    > -o file Write to file instead of standard output.
    > -q "Quiet mode:" redirect output to /dev/null if not to a file.
    > -r Print every string that matches each regular expression.
    > Regular expressions cannot contain + or * modifiers.
    > -S voice Send to speaker, having the given voice say it. If voice
    > is a null string, use the default voice.
    > -s char Separate fields with char, default space.
    > -t Separate fields with tabs.
    > -u Convert lowercase to uppercase. With -B, output in
    > uppercase letters for base > 10.
    > -V Strip non-printing characters.
    > -v Make non-printing characters visible.
    > -w If -l is given, word wrap instead of character wrap.
    > Otherwise, ignored.
    > -X Output in uppercase hexadecimal.
    > -x Output in lowercase hexadecimal.
    >
    > Test for everyone: write this echo in as little code as possible. C or
    > rc is permitted. The rules:
    > - for C: either Standard C (no other libraries) or only libc (no
    > other Plan 9 libraries)
    > - for rc: only use programs in the core Plan 9 distribution - no
    > programs that I have to get myself
    > - match the behavior EXACTLY as above
    > - shortest code and fastest run time wins
    > Winner gets something cool.
    >


    What should it do if you mix -f and -i?


  13. Re: [9fans] bug in echo?

    Ah good one.

    The order of interpretation is:

    -f
    -i
    command line

    On Apr 3, 2008, at 3:30 PM, Steven D. Vormwald wrote:

    > Pietro Gagliardi wrote:
    >> The ultimate echo, actually useful, but no one wants it.
    >> NAME
    >> echo: echo arguments
    >> SYNOPSIS
    >> echo [-1abCDEeilmNnOqrtuVvwXx] [-B base] [-c cmd] [-d char] [-
    >> f file] [-L len] [-o file] [-S voice] [-s char] [args...]
    >> DESCRIPTION
    >> echo outputs its arguments. It takes the following switches:
    >> -1 One argument per line.
    >> -a Output in ASCII. The default.
    >> -B base Output in given base, 2..32. Unless -u also given,
    >> base > 10 shows lowercase.
    >> -b Output in binary.
    >> -C Don't echo anything, just print the number of fields.
    >> -c cmd Run cmd on each argument, replacing $? with the
    >> argument itself.
    >> -D Output in decimal.
    >> -d char Field delimiter. Default is end of argument.
    >> -E Print to standard error instead of to standard output.
    >> -e Allow escape sequences
    >> -f file Read from file, then from command line (if any).
    >> -i Read arguments from standard input.
    >> -L len Line width set to len. Default is to ignore line
    >> lengths.
    >> -l Turn uppercase to lowercase.
    >> -m Multi-column output.
    >> -N One field per line, numbering each field.
    >> -n Suppress newline.
    >> -O Output in octal.
    >> -o file Write to file instead of standard output.
    >> -q "Quiet mode:" redirect output to /dev/null if not to
    >> a file.
    >> -r Print every string that matches each regular
    >> expression. Regular expressions cannot contain + or * modifiers.
    >> -S voice Send to speaker, having the given voice say it. If
    >> voice is a null string, use the default voice.
    >> -s char Separate fields with char, default space.
    >> -t Separate fields with tabs.
    >> -u Convert lowercase to uppercase. With -B, output in
    >> uppercase letters for base > 10.
    >> -V Strip non-printing characters.
    >> -v Make non-printing characters visible.
    >> -w If -l is given, word wrap instead of character wrap.
    >> Otherwise, ignored.
    >> -X Output in uppercase hexadecimal.
    >> -x Output in lowercase hexadecimal.
    >> Test for everyone: write this echo in as little code as possible.
    >> C or rc is permitted. The rules:
    >> - for C: either Standard C (no other libraries) or only libc
    >> (no other Plan 9 libraries)
    >> - for rc: only use programs in the core Plan 9 distribution -
    >> no programs that I have to get myself
    >> - match the behavior EXACTLY as above
    >> - shortest code and fastest run time wins
    >> Winner gets something cool.

    >
    > What should it do if you mix -f and -i?
    >




  14. Re: [9fans] bug in echo?

    Is -M the switch for the built-in mail reader?

    This is lunacy, or profound ignorance. You're duplicating
    functionality from about a half dozen other places in here,
    perhaps most significantly the shell. The software tools
    model gets its profound power from using simple tools
    which do one thing well and can be combined in arbitrary
    ways. Your... whatever... does lots of arbitrary things,
    while not actually doing much of anything for the user.

    If this is the "ultimate" echo, I fear for what "something
    cool" might be. I don't think my health could take it.
    Anthony



  15. Re: [9fans] bug in echo?

    You don't realize the point. I am agreeing with Kernighan and Pike:
    cat -v is harmful. So is ls -M, or echo -f, or rm -i. I'm showing a
    ludicrous echo command and challenging you to make it effective. What
    you'll find is surprising:
    1) Maintaining echo is harder than maintaining all of Microsoft
    Windows and Microsoft Office combined,
    2) That my question and my challenge and my echo were all rhetorical.

    Here is my ultimate echo (yours may vary):

    NAME
    echo -- echo argumens
    SYNOPSIS
    echo [-n] arguments
    DESCRIPTION
    echo prints arguments on standard output, followed by newline. If -n
    is given, no new line is added.
    BUGS
    To print -n and a newline, use
    echo -n '
    '

    On Apr 3, 2008, at 6:16 PM, a@9srv.net wrote:

    > Is -M the switch for the built-in mail reader?
    >
    > This is lunacy, or profound ignorance. You're duplicating
    > functionality from about a half dozen other places in here,
    > perhaps most significantly the shell. The software tools
    > model gets its profound power from using simple tools
    > which do one thing well and can be combined in arbitrary
    > ways. Your... whatever... does lots of arbitrary things,
    > while not actually doing much of anything for the user.
    >
    > If this is the "ultimate" echo, I fear for what "something
    > cool" might be. I don't think my health could take it.
    > Anthony
    >
    >




  16. Re: [9fans] bug in echo?

    On Thu, Apr 3, 2008 at 3:26 PM, Pietro Gagliardi wrote:
    > You don't realize the point. I am agreeing with Kernighan and Pike: cat -v
    > is harmful. So is ls -M, or echo -f, or rm -i. I'm showing a ludicrous echo
    > command and challenging you to make it effective. What you'll find is
    > surprising:
    > 1) Maintaining echo is harder than maintaining all of Microsoft Windows and
    > Microsoft Office combined,


    A bold claim, and a damn silly one.

    > 2) That my question and my challenge and my echo were all rhetorical.


    If they were rhetorical, you wouldn't have challenged us to implement
    your echo in the previous paragraph.

    > Here is my ultimate echo (yours may vary):
    >
    > NAME
    > echo -- echo argumens
    > SYNOPSIS
    > echo [-n] arguments
    > DESCRIPTION
    > echo prints arguments on standard output, followed by newline. If -n
    > is given, no new line is added.
    > BUGS
    > To print -n and a newline, use
    > echo -n '
    > '
    >


    A substandard re-writing of the existing echo(1) man page is your ultimate echo?
    Also,
    echo -n '
    '
    doesn't match current behavior and really makes zero sense.

    John
    --
    Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn


  17. Re: [9fans] bug in echo?

    Forgot a bit.

    echo -n '-n
    '

    On Apr 3, 2008, at 6:44 PM, John Floren wrote:

    > On Thu, Apr 3, 2008 at 3:26 PM, Pietro Gagliardi
    > wrote:
    >> You don't realize the point. I am agreeing with Kernighan and
    >> Pike: cat -v
    >> is harmful. So is ls -M, or echo -f, or rm -i. I'm showing a
    >> ludicrous echo
    >> command and challenging you to make it effective. What you'll find is
    >> surprising:
    >> 1) Maintaining echo is harder than maintaining all of Microsoft
    >> Windows and
    >> Microsoft Office combined,

    >
    > A bold claim, and a damn silly one.
    >
    >> 2) That my question and my challenge and my echo were all
    >> rhetorical.

    >
    > If they were rhetorical, you wouldn't have challenged us to implement
    > your echo in the previous paragraph.
    >
    >> Here is my ultimate echo (yours may vary):
    >>
    >> NAME
    >> echo -- echo argumens
    >> SYNOPSIS
    >> echo [-n] arguments
    >> DESCRIPTION
    >> echo prints arguments on standard output, followed by
    >> newline. If -n
    >> is given, no new line is added.
    >> BUGS
    >> To print -n and a newline, use
    >> echo -n '
    >> '
    >>

    >
    > A substandard re-writing of the existing echo(1) man page is your
    > ultimate echo?
    > Also,
    > echo -n '
    > '
    > doesn't match current behavior and really makes zero sense.
    >
    > John
    > --
    > Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn
    >




  18. Re: [9fans] bug in echo?

    Nobody appreciates a perfectly good joke anymore. (And I'm afraid I crossed
    that line with my name-calling earlier tonight...)

    * a@9srv.net (a@9srv.net) wrote:
    > Is -M the switch for the built-in mail reader?
    >
    > This is lunacy, or profound ignorance. You're duplicating
    > functionality from about a half dozen other places in here,
    > perhaps most significantly the shell. The software tools
    > model gets its profound power from using simple tools
    > which do one thing well and can be combined in arbitrary
    > ways. Your... whatever... does lots of arbitrary things,
    > while not actually doing much of anything for the user.
    >
    > If this is the "ultimate" echo, I fear for what "something
    > cool" might be. I don't think my health could take it.
    > Anthony



  19. Re: [9fans] bug in echo?

    In article <38229A66-D771-46FB-9D4B-B1A1733D0FF0@mac.com>,
    Pietro Gagliardi wrote:
    >The ultimate echo, actually useful, but no one wants it.
    >
    >NAME
    > echo: echo arguments
    >SYNOPSIS
    > echo [-1abCDEeilmNnOqrtuVvwXx] [-B base] [-c cmd] [-d char] [-f
    >file] [-L len] [-o file] [-S voice] [-s char] [args...]
    >DESCRIPTION
    > echo outputs its arguments. It takes the following switches:



    You missed a few things in this shudderingly horrible
    version of echo:

    1) no long options, which you need so you can have
    the --copyright and --version options.
    2) no roman numeral output.

    Fortunately, I have no self-respect and some spare time,
    so when I implemented this gem of design minimalism I
    put those horrible omissions in.

    http://www.pell.portland.or.us/~orc/Code/secho/

    I would have used the horrible FSF autoconfigure code,
    but it turns out that I've got some remaining standards.


    -david "share and enjoy!" parsons


  20. Re: [9fans] bug in echo?

    Better yet, provide -- options for each! And then provide some way of
    accessing them if -- won't work, like -f in gcc. And then let's add a -
    Q option that suppresses the banner which reads

    secho version xxx.xx
    a program to echo its arguments, but improved
    use the -h/--help option to get help
    distributed under no warranty; use --license for details

    Then let's add full locale support and an option to interpret and
    print decimal and monetary values, and an option to support formatted
    print a la printf and Console.Print (.net - but my memory of that is
    fading).

    On Apr 8, 2008, at 7:51 PM, david parsons wrote:

    > In article <38229A66-D771-46FB-9D4B-B1A1733D0FF0@mac.com>,
    > Pietro Gagliardi wrote:
    >> The ultimate echo, actually useful, but no one wants it.
    >>
    >> NAME
    >> echo: echo arguments
    >> SYNOPSIS
    >> echo [-1abCDEeilmNnOqrtuVvwXx] [-B base] [-c cmd] [-d char] [-f
    >> file] [-L len] [-o file] [-S voice] [-s char] [args...]
    >> DESCRIPTION
    >> echo outputs its arguments. It takes the following switches:

    >
    >
    > You missed a few things in this shudderingly horrible
    > version of echo:
    >
    > 1) no long options, which you need so you can have
    > the --copyright and --version options.
    > 2) no roman numeral output.
    >
    > Fortunately, I have no self-respect and some spare time,
    > so when I implemented this gem of design minimalism I
    > put those horrible omissions in.
    >
    > http://www.pell.portland.or.us/~orc/Code/secho/
    >
    > I would have used the horrible FSF autoconfigure code,
    > but it turns out that I've got some remaining standards.
    >
    >
    > -david "share and enjoy!" parsons
    >




+ Reply to Thread
Page 3 of 3 FirstFirst 1 2 3