Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, Just wondering, is there a fundamental difference between: cat textInput | ./prog_expecting_input and ./prog_expecting_input < textInput and cat textInput > ./prog_expecting_input Thanks in advance....
  1. #1
    Just Joined!
    Join Date
    Oct 2010
    Posts
    1

    Basic Shell/Script Question

    Hi,
    Just wondering, is there a fundamental difference between:
    cat textInput | ./prog_expecting_input
    and
    ./prog_expecting_input < textInput
    and
    cat textInput > ./prog_expecting_input
    Thanks in advance.
    Last edited by roswell88; 10-11-2010 at 03:07 PM.

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    Well, the last one won't work. The redirection operator > can only be used to redirect output into a file, not to a program. I think the other two are equivalent.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

Posting Permissions

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