<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: pipe or xargs in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/pipe-or-xargs/m-p/4330123#M62853</link>
    <description>&amp;gt;"pipe" pick the output of from the command on left, and make that output as an input to the command on right?&lt;BR /&gt;&lt;BR /&gt;output and input here refer to the stdout and stdin respectively, stdin is not same as command line args.&lt;BR /&gt;&lt;BR /&gt;If a program uses commandline args u have to use xargs.&lt;BR /&gt;If your program works on the input suplied on stdin; a | will be sufficient.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
    <pubDate>Tue, 30 Dec 2008 18:19:31 GMT</pubDate>
    <dc:creator>Srimalik</dc:creator>
    <dc:date>2008-12-30T18:19:31Z</dc:date>
    <item>
      <title>pipe or xargs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pipe-or-xargs/m-p/4330121#M62851</link>
      <description>echo -e "/usr\n/opt\n/bin" &amp;gt; file.txt&lt;BR /&gt;&lt;BR /&gt;1, cat file.txt |ls (doesnt work, this 'ls' will list only the contents of pwd, but doesnt list the output from 'file.txt')&lt;BR /&gt;2, cat file.txt |xargs ls (this works, i.e ls will list the out of 'file.txt')&lt;BR /&gt;&lt;BR /&gt;"pipe" pick the output of from the command on left, and make that output as an input to the command on right ?&lt;BR /&gt;then why "1" doesnt work as I expect(or as "2" works )&lt;BR /&gt;&lt;BR /&gt;e.g &lt;BR /&gt;3, echo 123 | mail -s "testing" root@localhost  (it works)&lt;BR /&gt;in this case(3), pipe is working as the definition, or simply the same as case "2"&lt;BR /&gt;&lt;BR /&gt;please help/explain&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Dec 2008 11:52:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pipe-or-xargs/m-p/4330121#M62851</guid>
      <dc:creator>Maaz</dc:creator>
      <dc:date>2008-12-30T11:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: pipe or xargs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pipe-or-xargs/m-p/4330122#M62852</link>
      <description>&amp;gt;1) cat file.txt | ls&lt;BR /&gt;&lt;BR /&gt;ls(1) doesn't take its input from stdin, only from command line args.  With a real shell (posix/ksh) you can do:&lt;BR /&gt;ls $(&amp;lt; file.txt )&lt;BR /&gt;&lt;BR /&gt;&amp;gt;2) cat file.txt | xargs ls (this works&lt;BR /&gt;&lt;BR /&gt;Yes, xargs reads stdin and then invokes ls with command line args.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;"pipe" pick the output of from the command on left, and make that output as an input to the command on right?&lt;BR /&gt;&lt;BR /&gt;Yes but there is no need to use evil cat(1) in your simple cases:&lt;BR /&gt;xargs ls &amp;lt; file.txt&lt;BR /&gt;&lt;BR /&gt;&amp;gt;then why "1" doesn't work as I expect&lt;BR /&gt;&lt;BR /&gt;Because "ls &amp;lt; file.txt" doesn't read stdin.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;3) echo 123 | mail -s "testing" root@localhost (it works)&lt;BR /&gt;&amp;gt;pipe is working as the definition&lt;BR /&gt;&lt;BR /&gt;The echo/pipe works because mail reads from stdin and has command line options.</description>
      <pubDate>Tue, 30 Dec 2008 12:45:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pipe-or-xargs/m-p/4330122#M62852</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-12-30T12:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: pipe or xargs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pipe-or-xargs/m-p/4330123#M62853</link>
      <description>&amp;gt;"pipe" pick the output of from the command on left, and make that output as an input to the command on right?&lt;BR /&gt;&lt;BR /&gt;output and input here refer to the stdout and stdin respectively, stdin is not same as command line args.&lt;BR /&gt;&lt;BR /&gt;If a program uses commandline args u have to use xargs.&lt;BR /&gt;If your program works on the input suplied on stdin; a | will be sufficient.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Dec 2008 18:19:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pipe-or-xargs/m-p/4330123#M62853</guid>
      <dc:creator>Srimalik</dc:creator>
      <dc:date>2008-12-30T18:19:31Z</dc:date>
    </item>
  </channel>
</rss>

