<?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: Case Statement Help needed in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-help-needed/m-p/4502509#M680892</link>
    <description>Sorry, I should have been clear in describing it. The ten files are below and after the files have been uploaded they will be removed and replaced by new files only the date stamps will change. Can you please advise accordingly.&lt;BR /&gt;&lt;BR /&gt;/home/abcd/test/17648.09232009.txt&lt;BR /&gt;/home/abcd/test/24901.09232009.txt&lt;BR /&gt;/home/abcd/test/89012.09232009.txt&lt;BR /&gt;/home/abcd/test/28943.09232009.txt&lt;BR /&gt;/home/abcd/test/14567.09232009.txt&lt;BR /&gt;/home/abcd/test/90284.09232009.txt&lt;BR /&gt;/home/abcd/test/80010.09232009.txt&lt;BR /&gt;/home/abcd/test/13456.09232009.txt&lt;BR /&gt;/home/abcd/test/39284.09232009.txt&lt;BR /&gt;/home/abcd/test/29940.09232009.txt&lt;BR /&gt;&lt;BR /&gt;/home/abcd/dev/17648.09232009.txt&lt;BR /&gt;/home/abcd/dev/24901.09232009.txt&lt;BR /&gt;/home/abcd/dev/89012.09232009.txt&lt;BR /&gt;/home/abcd/dev/28943.09232009.txt&lt;BR /&gt;/home/abcd/dev/14567.09232009.txt&lt;BR /&gt;/home/abcd/dev/90284.09232009.txt&lt;BR /&gt;/home/abcd/dev/80010.09232009.txt&lt;BR /&gt;/home/abcd/dev/13456.09232009.txt&lt;BR /&gt;/home/abcd/dev/39284.09232009.txt&lt;BR /&gt;/home/abcd/dev/29940.09232009.txt&lt;BR /&gt;&lt;BR /&gt;And I am trying to have separate logic for DEV and TEST.&lt;BR /&gt;&lt;BR /&gt;Thanks again.</description>
    <pubDate>Thu, 24 Sep 2009 01:08:10 GMT</pubDate>
    <dc:creator>rhansen</dc:creator>
    <dc:date>2009-09-24T01:08:10Z</dc:date>
    <item>
      <title>Case Statement Help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-help-needed/m-p/4502506#M680889</link>
      <description>I have twenty types of files under my home directory that needs to be uploaded that are broken into two groups of 10 each.&lt;BR /&gt;/home/abcd/test has 10 files&lt;BR /&gt;/home/abcd/dev has 10 files.&lt;BR /&gt;&lt;BR /&gt;The naming convention of files is five digit,date.txt example: 12345.09232009.txt and so on.&lt;BR /&gt;&lt;BR /&gt;Can someone help me in writing a case statement where it will have the logic to read files from test or dev directory and upload as necessary.&lt;BR /&gt;&lt;BR /&gt;I was thinking along the following lines:&lt;BR /&gt;upload_dir_test=/home/abcd/test&lt;BR /&gt;upload_dir_dev=/home/abcd/dev&lt;BR /&gt;&lt;BR /&gt;case $1 in&lt;BR /&gt;-u)&lt;BR /&gt;&lt;BR /&gt;  &lt;BR /&gt;   case $upload_dir_test in&lt;BR /&gt;     12345)&lt;BR /&gt;       upfile="12345*.txt"&lt;BR /&gt;       ;;&lt;BR /&gt;&lt;BR /&gt;Could someone help me guide to the best way of doing this?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Wed, 23 Sep 2009 21:29:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-help-needed/m-p/4502506#M680889</guid>
      <dc:creator>rhansen</dc:creator>
      <dc:date>2009-09-23T21:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-help-needed/m-p/4502507#M680890</link>
      <description>Hi&lt;BR /&gt;If the same naming convention is used in both directories then there is no test.  Right now you have&lt;BR /&gt;&lt;BR /&gt;12345......txt for both dev and test - what is the distinction?  The directory names?  Just the dir. names?</description>
      <pubDate>Wed, 23 Sep 2009 21:44:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-help-needed/m-p/4502507#M680890</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2009-09-23T21:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-help-needed/m-p/4502508#M680891</link>
      <description>&lt;!--!*#--&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;See if this helps:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset upload_dir_test=/tmp/TST&lt;BR /&gt;typeset upload_dir_dev=/tmp/DEV&lt;BR /&gt;&lt;BR /&gt;case $1 in&lt;BR /&gt;    -t )&lt;BR /&gt;        cd ${upload_dir_test} || exit 1&lt;BR /&gt;    ;;&lt;BR /&gt;    -d )&lt;BR /&gt;        cd ${upload_dir_dev} || exit 1&lt;BR /&gt;    ;;&lt;BR /&gt;    *  )&lt;BR /&gt;        echo "bad option"; exit 1&lt;BR /&gt;    ;;&lt;BR /&gt;esac&lt;BR /&gt;upfile=$(ls -1 [0-9][0-9][0-9][0-9][0-9]*.txt 2&amp;gt;/dev/null)&lt;BR /&gt;echo ${upfile}&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 23 Sep 2009 22:00:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-help-needed/m-p/4502508#M680891</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-09-23T22:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-help-needed/m-p/4502509#M680892</link>
      <description>Sorry, I should have been clear in describing it. The ten files are below and after the files have been uploaded they will be removed and replaced by new files only the date stamps will change. Can you please advise accordingly.&lt;BR /&gt;&lt;BR /&gt;/home/abcd/test/17648.09232009.txt&lt;BR /&gt;/home/abcd/test/24901.09232009.txt&lt;BR /&gt;/home/abcd/test/89012.09232009.txt&lt;BR /&gt;/home/abcd/test/28943.09232009.txt&lt;BR /&gt;/home/abcd/test/14567.09232009.txt&lt;BR /&gt;/home/abcd/test/90284.09232009.txt&lt;BR /&gt;/home/abcd/test/80010.09232009.txt&lt;BR /&gt;/home/abcd/test/13456.09232009.txt&lt;BR /&gt;/home/abcd/test/39284.09232009.txt&lt;BR /&gt;/home/abcd/test/29940.09232009.txt&lt;BR /&gt;&lt;BR /&gt;/home/abcd/dev/17648.09232009.txt&lt;BR /&gt;/home/abcd/dev/24901.09232009.txt&lt;BR /&gt;/home/abcd/dev/89012.09232009.txt&lt;BR /&gt;/home/abcd/dev/28943.09232009.txt&lt;BR /&gt;/home/abcd/dev/14567.09232009.txt&lt;BR /&gt;/home/abcd/dev/90284.09232009.txt&lt;BR /&gt;/home/abcd/dev/80010.09232009.txt&lt;BR /&gt;/home/abcd/dev/13456.09232009.txt&lt;BR /&gt;/home/abcd/dev/39284.09232009.txt&lt;BR /&gt;/home/abcd/dev/29940.09232009.txt&lt;BR /&gt;&lt;BR /&gt;And I am trying to have separate logic for DEV and TEST.&lt;BR /&gt;&lt;BR /&gt;Thanks again.</description>
      <pubDate>Thu, 24 Sep 2009 01:08:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-help-needed/m-p/4502509#M680892</guid>
      <dc:creator>rhansen</dc:creator>
      <dc:date>2009-09-24T01:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-help-needed/m-p/4502510#M680893</link>
      <description>Hello!&lt;BR /&gt;&lt;BR /&gt;Script is attached.&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;&lt;BR /&gt;Kobylka</description>
      <pubDate>Thu, 24 Sep 2009 07:32:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-help-needed/m-p/4502510#M680893</guid>
      <dc:creator>kobylka</dc:creator>
      <dc:date>2009-09-24T07:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-help-needed/m-p/4502511#M680894</link>
      <description>&amp;gt;case $upload_dir_test in&lt;BR /&gt;12345) upfile="12345*.txt"&lt;BR /&gt;&lt;BR /&gt;I'm not sure what you want to do here.&lt;BR /&gt;If you want to upload all files with the pattern: [0-9][0-9][0-9][0-9][0-9].[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].txt&lt;BR /&gt;&lt;BR /&gt;Then you can simply use ls to find them:&lt;BR /&gt;ls $upload_dir_test/[0-9][0-9][0-9][0-9][0-9].[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].txt&lt;BR /&gt;Or you can use grep after ls:&lt;BR /&gt;ls $upload_dir_test | grep "[0-9]\{5\}\.[0-9]\{8\}\.txt"</description>
      <pubDate>Thu, 24 Sep 2009 09:01:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/case-statement-help-needed/m-p/4502511#M680894</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-09-24T09:01:24Z</dc:date>
    </item>
  </channel>
</rss>

