The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: echo with stdin
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 09-28-2006
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,933
That is not what echo does. echo prints the commandline arguments it is given, not stdin, not any other file, period. xargs is a workaround that translates things read from stdin into commandline arguments for it, an extra program to join them together. You can limit the number of commands xargs gives to a command like
Code:
xargs --max-args=1 echo < file
But, again, why not just use cat? That's what it's there for.