<?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: Help (again) in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160841#M684501</link>
    <description>James, would I slide those in after the dt= line?</description>
    <pubDate>Tue, 03 Mar 2009 15:31:13 GMT</pubDate>
    <dc:creator>Adam W.</dc:creator>
    <dc:date>2009-03-03T15:31:13Z</dc:date>
    <item>
      <title>Help (again)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160839#M684499</link>
      <description>Guru's, hello again. I am having a bit of an issue with the attached script. (You all out there helped with) I am getting several errors like the one below , when the script runs:&lt;BR /&gt;&lt;BR /&gt;/tmp/list1.29752 not found&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;*************************************************&lt;BR /&gt;Cron: The previous message is the standard output&lt;BR /&gt;      and standard error of one of your crontab commands:&lt;BR /&gt;&lt;BR /&gt;/usr/local/bin/filesystemcheck.sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;IS there a way I can modify the script to use "touch" to create necesary files to ensure they are there?</description>
      <pubDate>Tue, 03 Mar 2009 14:45:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160839#M684499</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-03-03T14:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help (again)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160840#M684500</link>
      <description>Hi Adam:&lt;BR /&gt;&lt;BR /&gt;Most certainly you can use 'touch' to create files to insure their presence.  Of course, you can also test for their presence too:&lt;BR /&gt;&lt;BR /&gt;# FILE=/tmp/mylist&lt;BR /&gt;# [ -f "${FILE}" ] &amp;amp;&amp;amp; echo "${FILE} exists" || touch ${FILE}&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 03 Mar 2009 14:49:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160840#M684500</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-03T14:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help (again)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160841#M684501</link>
      <description>James, would I slide those in after the dt= line?</description>
      <pubDate>Tue, 03 Mar 2009 15:31:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160841#M684501</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-03-03T15:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help (again)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160842#M684502</link>
      <description>Hi (again) Adam:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; would I slide those in after the dt= line?&lt;BR /&gt;&lt;BR /&gt;I don't see anything in the attached script that has the string "list" in it.&lt;BR /&gt;&lt;BR /&gt;As for this code:&lt;BR /&gt;&lt;BR /&gt;dt=`date +bdf%m%d%y%H`&lt;BR /&gt;existence=`ll /tmp | grep $dt`&lt;BR /&gt;if [ -n "$existence" ]&lt;BR /&gt;then&lt;BR /&gt;     exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;...It assumes that the file named by the value of '${dt}' exists if it lives in the '/tmp' directory.  A much better approach might be:&lt;BR /&gt;&lt;BR /&gt;cd /tmp &amp;amp;&amp;amp; exit 1&lt;BR /&gt;dt=$(date +bdf%m%d%y%H)&lt;BR /&gt;[ -f "${dt}" ] || exit&lt;BR /&gt;&lt;BR /&gt;...which would exit if the file didn't exist.&lt;BR /&gt;&lt;BR /&gt;If you want to create the file if it isn't there, do what I first suggested:&lt;BR /&gt;&lt;BR /&gt;cd /tmp &amp;amp;&amp;amp; exit 1&lt;BR /&gt;dt=$(date +bdf%m%d%y%H)&lt;BR /&gt;[ -f "${dt}" ] || touch ${dt}&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Mar 2009 15:51:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160842#M684502</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-03T15:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help (again)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160843#M684503</link>
      <description>James I tried it with:&lt;BR /&gt;&lt;BR /&gt;cd /tmp &amp;amp;&amp;amp; exit 1&lt;BR /&gt;dt=$(date +bdf%m%d%y%H)&lt;BR /&gt;[ -f "${dt}" ] || touch ${dt}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and I added a -x to the shebang, but all it does is gives me:&lt;BR /&gt;+cd&lt;BR /&gt;+exit &lt;BR /&gt;&lt;BR /&gt;and nothing else runs.</description>
      <pubDate>Tue, 03 Mar 2009 16:04:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160843#M684503</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-03-03T16:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help (again)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160844#M684504</link>
      <description>Hi (again) Adam:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; cd /tmp &amp;amp;&amp;amp; exit 1&lt;BR /&gt;&lt;BR /&gt;Oops, my reversed thinking.  This says "cd to /tmp" but if you DO (successfully) then 'exit' !  I meant:&lt;BR /&gt;&lt;BR /&gt;# cd /tmp || exit 1&lt;BR /&gt;&lt;BR /&gt;...meaning if you can't change directories to /tmp, then exit.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 03 Mar 2009 16:10:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160844#M684504</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-03T16:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help (again)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160845#M684505</link>
      <description>Ah ok. LOL. Happens to us all. One last question though. When I run it with the -x after the shabang I get this in the output:&lt;BR /&gt;&lt;BR /&gt;+ [ -fbdf03030910]&lt;BR /&gt;/usr/local/bin/filechecktest.sh[23]: test: A ] character is missing.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thoughts on it?&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Mar 2009 16:14:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160845#M684505</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-03-03T16:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help (again)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160846#M684506</link>
      <description>&lt;!--!*#--&gt;Hi Adam:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; usr/local/bin/filechecktest.sh[23]: test: A ] character is missing&lt;BR /&gt;&lt;BR /&gt;...means that at (about) line-23 of your script in a 'test' operation, a bracket wasn't found where/when expected.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Since you see:&lt;BR /&gt;&lt;BR /&gt;+ [ -fbdf03030910]&lt;BR /&gt;&lt;BR /&gt;I you didn't observe the proper whitespace rules (the shell is picky).  Be sure you wrote:&lt;BR /&gt;&lt;BR /&gt;[ -f "${dt}" ] || touch ${dt}&lt;BR /&gt;&lt;BR /&gt;...note too that we double-quote the variables in the 'test' command (that in square brackets).  This protects us from errors if the 'dt' variable is empty, which would evaluate syntatically OK.&lt;BR /&gt;&lt;BR /&gt;Compare these:&lt;BR /&gt;&lt;BR /&gt;# XFILE=""&lt;BR /&gt;# [ -f ${XFILE} ] || echo no-file&lt;BR /&gt;sh: test: Specify a parameter with this command.&lt;BR /&gt;&lt;BR /&gt;...with:&lt;BR /&gt;&lt;BR /&gt;[ -f "${XFILE}" ] || echo no-file&lt;BR /&gt;no-file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;...wh&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Mar 2009 16:26:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160846#M684506</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-03T16:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help (again)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160847#M684507</link>
      <description>Got it! Was missing a space. James, Always a pleasure Sir. Thank you (once again) for your help.</description>
      <pubDate>Tue, 03 Mar 2009 16:39:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160847#M684507</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-03-03T16:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help (again)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160848#M684508</link>
      <description>&amp;gt;Was missing a space&lt;BR /&gt;&lt;BR /&gt;I would also suggest a space after -f or any other test operator.</description>
      <pubDate>Tue, 03 Mar 2009 17:11:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-again/m-p/5160848#M684508</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-03-03T17:11:33Z</dc:date>
    </item>
  </channel>
</rss>

