Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004

    Unanswered: > file2 < file1 cat

    Hi all,

    thanks Damian and vgersh99 for answering my sed question,

    can i check this command which surprise me why cn cat be place at the end of the command

    > file2 < file1 cat

    i ran and find that the contents of file1 are copied to file2.


  2. #2
    Join Date
    Jun 2002
    The command is actually shorthand for...

    1>file2 0<file1 cat

    This means:

    Send standard output (which is file descriptor 1 by default) to file2.
    Read standard input (which is file descriptor 0 by default) from file1.
    These conditions are now set for the following 'cat' command, so cat reads standard input from file1 and sends its output to file2.

    The results is the contents of file1 are 'copied' to file2.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts