#1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Nobbies beach, Gold Coast. It's beautiful.
    Posts
    2,582
    Rep Power
    171

    Man echo is not complete!


    Hi;

    Why don't I get any information of -e for example? How a can I get full informaiton on something, echo for example?


    192-128-7-3:~ pqwmdg1$ man echo

    ECHO(1) BSD General Commands Manual ECHO(1)

    NAME
    echo -- write arguments to the standard output

    SYNOPSIS
    echo [-n] [string ...]

    DESCRIPTION
    The echo utility writes any specified operands, separated by single blank (` ') characters and followed by a newline (`\n') character, to the standard out-
    put.

    The following option is available:

    -n Do not print the trailing newline character. This may also be achieved by appending `\c' to the end of the string, as is done by iBCS2 compatible
    systems. Note that this option as well as the effect of `\c' are implementation-defined in IEEE Std 1003.1-2001 (``POSIX.1'') as amended by Cor.
    1-2002. Applications aiming for maximum portability are strongly encouraged to use printf(1) to suppress the newline character.

    Some shells may provide a builtin echo command which is similar or identical to this utility. Most notably, the builtin echo in sh(1) does not accept the
    -n option. Consult the builtin(1) manual page.

    EXIT STATUS
    The echo utility exits 0 on success, and >0 if an error occurs.

    SEE ALSO
    builtin(1), csh(1), printf(1), sh(1)

    STANDARDS
    The echo utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'') as amended by Cor. 1-2002.

    BSD April 12, 2003 BSD
    (END)
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,402
    Rep Power
    1688
    Because different versions of *nix have different commands/options - standards, dontcha just love 'em, so many to choose from!
    Try this
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  4. #3
  5. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Nobbies beach, Gold Coast. It's beautiful.
    Posts
    2,582
    Rep Power
    171
    Originally Posted by SimonJM
    Because different versions of *nix have different commands/options - standards, dontcha just love 'em, so many to choose from!
    Try this
    Hi

    Yes I understand, it would have made more sense if it was in the manual since it is a working feature
  6. #4
  7. Wiser? Not exactly.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    5,906
    Rep Power
    3969
    Some of the basic things like echo may be built into the shell rather than being a separate program also, in which case you need to check the shell's man page. For instance, if you use bash:
    http://linux.die.net/man/1/bash

    Do a search for 'echo' and you'll find it, roughly 3/4 the way down.
    Recycle your old CD's, don't just trash them



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  8. #5
  9. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Nobbies beach, Gold Coast. It's beautiful.
    Posts
    2,582
    Rep Power
    171
    Originally Posted by kicken
    Some of the basic things like echo may be built into the shell rather than being a separate program also, in which case you need to check the shell's man page. For instance, if you use bash:
    http://linux.die.net/man/1/bash

    Do a search for 'echo' and you'll find it, roughly 3/4 the way down.
    Thanks Kick;

    Just wondering if you could tell me about this as well:
    Code:
    grep '714' file > file2
    This finds any line including p and copies it to file2.

    But the explaination says:
    redirecting standard output to file2
    It is copying and saving! Isn't it? Why does it say redirect in the manual?

    Thanks
  10. #6
  11. Wiser? Not exactly.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    5,906
    Rep Power
    3969
    Originally Posted by English Breakfast Tea
    Why does it say redirect in the manual?
    Because that is what it does, it redirects the output. Normally the STDOUT stream is printed out on your terminal screen. When you use > you're telling the shell to send the stream to a file rather than print it out on screen.
    Recycle your old CD's, don't just trash them



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  12. #7
  13. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Nobbies beach, Gold Coast. It's beautiful.
    Posts
    2,582
    Rep Power
    171
    Originally Posted by kicken
    Because that is what it does, it redirects the output. Normally the STDOUT stream is printed out on your terminal screen. When you use > you're telling the shell to send the stream to a file rather than print it out on screen.
    Um, to me it is just explaining copy and "save" to another file.

    Does it make sense to you? You know what I mean?
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,402
    Rep Power
    1688
    Most everything in *nix is a 'file': how the system sees it disks, it's intenet connection and, of course, files. It is down to the process that uses the file in question as to what it will do. This is waht makes *nix quite so flexible.
    Your running shell has, by default, 3 open files associated with it, with file numbers 0, 1 and 2 which are for input, output and error reporting (STDIN, STDOUT and STDERR).
    By default they are: STDIN reads from keyboard, STDOUT and STDERR print to screen.

    You can pipe the outputs into another command (using the | symbol) to have the STDOUT of one process read as the STDIN of the next in the chain: proc1 | proc2. That means that instead of getting the input from the user via the keyboard proc2 will take it from the output mase by proc1.

    You can redirect the output - send it to another file. Note the difference here - send to a file, not another process! By using the basic redirect option (the > symbol) you can send the output of a process to another file: proc1 > file1. Than means instead of you seeing the output on screen it will, instead, be sent to a file called file1. If that file exists it will be over-written and if it does not exist it will be created.
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc

IMN logo majestic logo threadwatch logo seochat tools logo