<?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 &amp;quot;cannot open input file&amp;quot; with a script using the split command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120172#M150620</link>
    <description>I have createad a script using the following syntax:&lt;BR /&gt;&lt;BR /&gt;split -b nm /dir/inputfile /dir/outputfile&lt;BR /&gt;or &lt;BR /&gt;split -b nk /dir/inputfile /dir/outputfile&lt;BR /&gt;or&lt;BR /&gt;split -l n /dir/inputfile /dir/outputfile&lt;BR /&gt;&lt;BR /&gt;as specified by the user.  The script is attached.&lt;BR /&gt;&lt;BR /&gt;Problem:  If I do everything manually it works fine, but while running the script I am getting the "cannot open input file"... What am I overlooking?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;</description>
    <pubDate>Sat, 15 Nov 2003 18:53:58 GMT</pubDate>
    <dc:creator>MAD_2</dc:creator>
    <dc:date>2003-11-15T18:53:58Z</dc:date>
    <item>
      <title>"cannot open input file" with a script using the split command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120172#M150620</link>
      <description>I have createad a script using the following syntax:&lt;BR /&gt;&lt;BR /&gt;split -b nm /dir/inputfile /dir/outputfile&lt;BR /&gt;or &lt;BR /&gt;split -b nk /dir/inputfile /dir/outputfile&lt;BR /&gt;or&lt;BR /&gt;split -l n /dir/inputfile /dir/outputfile&lt;BR /&gt;&lt;BR /&gt;as specified by the user.  The script is attached.&lt;BR /&gt;&lt;BR /&gt;Problem:  If I do everything manually it works fine, but while running the script I am getting the "cannot open input file"... What am I overlooking?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;</description>
      <pubDate>Sat, 15 Nov 2003 18:53:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120172#M150620</guid>
      <dc:creator>MAD_2</dc:creator>
      <dc:date>2003-11-15T18:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: "cannot open input file" with a script using the split command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120173#M150621</link>
      <description>reboot</description>
      <pubDate>Sat, 15 Nov 2003 19:43:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120173#M150621</guid>
      <dc:creator>James Murtagh</dc:creator>
      <dc:date>2003-11-15T19:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: "cannot open input file" with a script using the split command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120174#M150622</link>
      <description>Hi there,&lt;BR /&gt;&lt;BR /&gt;My upmost apologies. I leave my computer on so my flatmates can browse the internet....it seems now they cannot be trusted. I hope this hasn't discouraged your use of the forum.&lt;BR /&gt;&lt;BR /&gt;If you set a shell echo in your script, i.e. run :&lt;BR /&gt;&lt;BR /&gt;# ksh -x &amp;lt;script&amp;gt;&lt;BR /&gt;&lt;BR /&gt;You will have a better idea where the script is failing.&lt;BR /&gt;&lt;BR /&gt;Again, I am very sorry.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;James.&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Sat, 15 Nov 2003 20:00:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120174#M150622</guid>
      <dc:creator>James Murtagh</dc:creator>
      <dc:date>2003-11-15T20:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: "cannot open input file" with a script using the split command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120175#M150623</link>
      <description>Jame's idea is excellent.&lt;BR /&gt;&lt;BR /&gt;You might want to add tests for the existance of the file involved into your script.&lt;BR /&gt;&lt;BR /&gt;if [ -f filename $filename ] stuff.&lt;BR /&gt;&lt;BR /&gt;My crib sheet isn't handy right now.&lt;BR /&gt;&lt;BR /&gt;reboot huh?&lt;BR /&gt;&lt;BR /&gt;Sure, it was the roommates.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Sat, 15 Nov 2003 20:22:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120175#M150623</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-11-15T20:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: "cannot open input file" with a script using the split command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120176#M150624</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you have a small error in your script.&lt;BR /&gt;split -b $KBSIZEk $WKDIR/$FILENAME $RESDIR/$FILENAME.&lt;BR /&gt;The shell evaluates the variable $KBSIZEk because it can not know, that k is not part of the variable name and of course this will &lt;BR /&gt;result in nothing, because it is not set.&lt;BR /&gt;use ${KBSIZE}k&lt;BR /&gt;Now the skell knows, what to evaluate.&lt;BR /&gt;Also the 1st line should be&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Sat, 15 Nov 2003 21:12:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120176#M150624</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-11-15T21:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: "cannot open input file" with a script using the split command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120177#M150625</link>
      <description>L.S&lt;BR /&gt;&lt;BR /&gt;Michael is completely right about the variables. Iy may be a small error, but small errors tend to be fatal for your scripts.&lt;BR /&gt;Your first line is wrong too, as Michael says.&lt;BR /&gt;&lt;BR /&gt;You may want to add a line near the beginning:&lt;BR /&gt;set -u         # undefined variable -&amp;gt; error&lt;BR /&gt;&lt;BR /&gt;If the shell encounters an undefined variable, it will complain about that.&lt;BR /&gt;&lt;BR /&gt;For debugging, add a 'set -xv'.&lt;BR /&gt;&lt;BR /&gt;Good luck.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Sun, 16 Nov 2003 07:41:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120177#M150625</guid>
      <dc:creator>Jeroen Peereboom</dc:creator>
      <dc:date>2003-11-16T07:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: "cannot open input file" with a script using the split command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120178#M150626</link>
      <description>Michael's response is what fixed my problem, the brackets around the variable names (like the example he used of ${KBSIZE}k instead of simply $KBSIZEk) was probably what was causing the problem, those variables and the first line of my script were the only things I changed before I tried again and then everything worked as expected.&lt;BR /&gt;&lt;BR /&gt;Once again, you guys are great...  Thanks!</description>
      <pubDate>Sun, 16 Nov 2003 07:49:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-cannot-open-input-file-quot-with-a-script-using-the-split/m-p/3120178#M150626</guid>
      <dc:creator>MAD_2</dc:creator>
      <dc:date>2003-11-16T07:49:56Z</dc:date>
    </item>
  </channel>
</rss>

