<?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: Syntax error for shell script pipe in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/syntax-error-for-shell-script-pipe/m-p/5008113#M425932</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You would get an error.  This comes from an older post that was mangled by a Forum database conversion some years ago.&lt;BR /&gt;&lt;BR /&gt;You want:&lt;BR /&gt;&lt;BR /&gt;# if [ -s "$i" ]&lt;BR /&gt;&lt;BR /&gt;...in place of :&lt;BR /&gt;&lt;BR /&gt;# if [ -s "$i" ]&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Wed, 11 Oct 2006 14:24:57 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2006-10-11T14:24:57Z</dc:date>
    <item>
      <title>Syntax error for shell script pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/syntax-error-for-shell-script-pipe/m-p/5008112#M425931</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I read in this forum about check for standard input, but when I run the script, I got error as follow:&lt;BR /&gt;&lt;BR /&gt;# ./teste.sh&lt;BR /&gt;./teste.sh: Syntax error at line 3 : `&amp;amp;' is not expected.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;for i in `ls -1`&lt;BR /&gt;do&lt;BR /&gt;if [ -s "$i" ]&lt;BR /&gt;then&lt;BR /&gt;print $i&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I´d apreciate any help.&lt;BR /&gt;&lt;BR /&gt;Tks&lt;BR /&gt;&lt;BR /&gt;Schimidt</description>
      <pubDate>Wed, 11 Oct 2006 14:17:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/syntax-error-for-shell-script-pipe/m-p/5008112#M425931</guid>
      <dc:creator>Carlos Roberto Schimidt</dc:creator>
      <dc:date>2006-10-11T14:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error for shell script pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/syntax-error-for-shell-script-pipe/m-p/5008113#M425932</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You would get an error.  This comes from an older post that was mangled by a Forum database conversion some years ago.&lt;BR /&gt;&lt;BR /&gt;You want:&lt;BR /&gt;&lt;BR /&gt;# if [ -s "$i" ]&lt;BR /&gt;&lt;BR /&gt;...in place of :&lt;BR /&gt;&lt;BR /&gt;# if [ -s "$i" ]&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 11 Oct 2006 14:24:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/syntax-error-for-shell-script-pipe/m-p/5008113#M425932</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-10-11T14:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error for shell script pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/syntax-error-for-shell-script-pipe/m-p/5008114#M425933</link>
      <description>you need to put your if test condition in square brackets, as in:&lt;BR /&gt;&lt;BR /&gt;if you replace "$i" with ${i}, I think your script has a chance of working.&lt;BR /&gt;&lt;BR /&gt;provided &lt;BR /&gt;&lt;BR /&gt;[ is a [&lt;BR /&gt;&lt;BR /&gt;and &lt;BR /&gt;&lt;BR /&gt;] is a ]&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Oct 2006 14:27:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/syntax-error-for-shell-script-pipe/m-p/5008114#M425933</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2006-10-11T14:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error for shell script pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/syntax-error-for-shell-script-pipe/m-p/5008115#M425934</link>
      <description>No idea where you would have got that from, but I think what your trying to do is test if the file exists and is not zero.&lt;BR /&gt;&lt;BR /&gt;if [[ -s $i ]];then&lt;BR /&gt;print&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Oct 2006 14:29:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/syntax-error-for-shell-script-pipe/m-p/5008115#M425934</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2006-10-11T14:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error for shell script pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/syntax-error-for-shell-script-pipe/m-p/5008116#M425935</link>
      <description>Thanks all,&lt;BR /&gt;&lt;BR /&gt;Now it´s work&lt;BR /&gt;&lt;BR /&gt;#  ./teste.sh&lt;BR /&gt;No piped input&lt;BR /&gt;&lt;BR /&gt;# echo "test" | ./teste.sh&lt;BR /&gt;test&lt;BR /&gt;Piped input is&lt;BR /&gt;&lt;BR /&gt;# cat teste.sh&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;if [ -t 0 ];  then&lt;BR /&gt;        echo "No piped input"&lt;BR /&gt;else&lt;BR /&gt;        cat -&lt;BR /&gt;        echo "Piped input is $data"&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Oct 2006 14:33:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/syntax-error-for-shell-script-pipe/m-p/5008116#M425935</guid>
      <dc:creator>Carlos Roberto Schimidt</dc:creator>
      <dc:date>2006-10-11T14:33:43Z</dc:date>
    </item>
  </channel>
</rss>

