<?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: Need Help On Script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/need-help-on-script/m-p/4944064#M102902</link>
    <description>Thanks a lot</description>
    <pubDate>Fri, 02 Dec 2005 02:04:37 GMT</pubDate>
    <dc:creator>Venkat_33</dc:creator>
    <dc:date>2005-12-02T02:04:37Z</dc:date>
    <item>
      <title>Need Help On Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/need-help-on-script/m-p/4944061#M102899</link>
      <description>Hi guys,&lt;BR /&gt;&lt;BR /&gt;I developed script contains i have some files like IMExxxxx and IMFxxxxx in /home/abc/test folder,&lt;BR /&gt; if it start IME it will go to IME Loop and for IMF will go to IMF Loop &lt;BR /&gt; &lt;BR /&gt; if it goes to IME loop then after i want to find string IMCT and GWAY in IME Files&lt;BR /&gt; &lt;BR /&gt; But i developed but it going on first loop only i.e IME Loop only&lt;BR /&gt;&lt;BR /&gt;script is given below&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;export DIRECTORY=/home/abc/test&lt;BR /&gt;export DATETIME=`date +"%y%m%d%S"`&lt;BR /&gt;export IME=test_ime&lt;BR /&gt;export GSE=test_gse&lt;BR /&gt;export IMF=test_imf&lt;BR /&gt;export GWY=test_gwy&lt;BR /&gt;export TMP=tmp&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;for file in $( find $DIRECTORY -type f -name '*.*' | sort )&lt;BR /&gt;do&lt;BR /&gt; FNAME=`echo ${file} |cut -c 16-18`&lt;BR /&gt; echo $FNAME&lt;BR /&gt; STNG=$(awk '(NR==2) { print substr($0,34,4); }' ${file})&lt;BR /&gt; if [ $FNAME==IME ]&lt;BR /&gt; then &lt;BR /&gt;     echo $STNG"hi"&lt;BR /&gt;  if [ $STNG=="IMCT" ]&lt;BR /&gt;  then&lt;BR /&gt;  echo $STNG"IMCT Loop"&lt;BR /&gt;      mv ${WRKFILE} ${DIRECTORY}/${IME}&lt;BR /&gt;     elif [ $STNG==GWAY ] &lt;BR /&gt;     then&lt;BR /&gt;   echo $STNG"GWAY Loop"&lt;BR /&gt;       mv ${WRKFILE} ${DIRECTORY}/${GWY}&lt;BR /&gt;     fi&lt;BR /&gt; elif [ $FNAME==IMF ]&lt;BR /&gt; then &lt;BR /&gt; echo $FNAME"IMF Loop"&lt;BR /&gt; mv ${WRKFILE} ${DIRECTORY}/${IMF}&lt;BR /&gt; else&lt;BR /&gt;    mv ${DIRECTORY}/${WRKFILE} ${DIRECTORY}/${GSE}&lt;BR /&gt; fi&lt;BR /&gt;done</description>
      <pubDate>Thu, 01 Dec 2005 23:37:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/need-help-on-script/m-p/4944061#M102899</guid>
      <dc:creator>Venkat_33</dc:creator>
      <dc:date>2005-12-01T23:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help On Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/need-help-on-script/m-p/4944062#M102900</link>
      <description>Shalom Sir,&lt;BR /&gt;&lt;BR /&gt; if [ $FNAME==IME ]&lt;BR /&gt;then&lt;BR /&gt;echo $STNG"hi"&lt;BR /&gt;if [ $STNG=="IMCT" ]&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;ITRC makes this very hard to read.&lt;BR /&gt;&lt;BR /&gt;But it seems that IMCT is only testted for if you get a hit on IME.&lt;BR /&gt;&lt;BR /&gt;I think your if/fi structure needs to be done so all items are tested for on the first loop.&lt;BR /&gt;&lt;BR /&gt;Thats not how its coded now.&lt;BR /&gt;&lt;BR /&gt;Also you use of quotes is inconsistent. Good shell programmers are at least consistent. Usually its better to use them than not, though it actually makes no difference if there are no whitespaces in the output.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Fri, 02 Dec 2005 01:01:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/need-help-on-script/m-p/4944062#M102900</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-12-02T01:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help On Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/need-help-on-script/m-p/4944063#M102901</link>
      <description>Thanks Steven,&lt;BR /&gt;&lt;BR /&gt;Now my script is working and also i started develop script just a month back.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Dec 2005 02:04:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/need-help-on-script/m-p/4944063#M102901</guid>
      <dc:creator>Venkat_33</dc:creator>
      <dc:date>2005-12-02T02:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help On Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/need-help-on-script/m-p/4944064#M102902</link>
      <description>Thanks a lot</description>
      <pubDate>Fri, 02 Dec 2005 02:04:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/need-help-on-script/m-p/4944064#M102902</guid>
      <dc:creator>Venkat_33</dc:creator>
      <dc:date>2005-12-02T02:04:37Z</dc:date>
    </item>
  </channel>
</rss>

