<?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 me the shell script... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971806#M120519</link>
    <description>grep 3560 number&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
    <pubDate>Tue, 13 May 2003 11:05:51 GMT</pubDate>
    <dc:creator>Pete Randall</dc:creator>
    <dc:date>2003-05-13T11:05:51Z</dc:date>
    <item>
      <title>Help me the shell script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971805#M120518</link>
      <description>The content of a file named "number" :&lt;BR /&gt;&lt;BR /&gt;2210&lt;BR /&gt;2234&lt;BR /&gt;3560&lt;BR /&gt;&lt;BR /&gt;I want to write my own shell script "test.sh" which translate the number to the program using the command such as :&lt;BR /&gt;sh test.sh 3560&lt;BR /&gt;&lt;BR /&gt;This script is used to locate the rows of the number. &lt;BR /&gt;&lt;BR /&gt;So anybody can give me some suggestions to write the script, thanks!</description>
      <pubDate>Tue, 13 May 2003 11:02:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971805#M120518</guid>
      <dc:creator>darkdream</dc:creator>
      <dc:date>2003-05-13T11:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help me the shell script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971806#M120519</link>
      <description>grep 3560 number&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 13 May 2003 11:05:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971806#M120519</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-05-13T11:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help me the shell script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971807#M120520</link>
      <description>not sure what result you want?&lt;BR /&gt;&lt;BR /&gt;loop to go line by line through file:&lt;BR /&gt;--&lt;BR /&gt;for i in $(cat /path/to/number)&lt;BR /&gt;do&lt;BR /&gt; #perform action&lt;BR /&gt;done&lt;BR /&gt;--&lt;BR /&gt;&lt;BR /&gt;look for occurance of input arg number 1 in file:&lt;BR /&gt;--&lt;BR /&gt;grep $1 /path/to/number&lt;BR /&gt;echo $?&lt;BR /&gt;--&lt;BR /&gt;&lt;BR /&gt;Later,&lt;BR /&gt;Bill</description>
      <pubDate>Tue, 13 May 2003 11:07:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971807#M120520</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2003-05-13T11:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help me the shell script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971808#M120521</link>
      <description>grep 3560 number &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 13 May 2003 11:10:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971808#M120521</guid>
      <dc:creator>Ricardo Bassoi</dc:creator>
      <dc:date>2003-05-13T11:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help me the shell script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971809#M120522</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;As mentioned before try using the grep command.&lt;BR /&gt;&lt;BR /&gt;grep 2210 /path/filename&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;DR</description>
      <pubDate>Tue, 13 May 2003 11:22:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971809#M120522</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2003-05-13T11:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help me the shell script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971810#M120523</link>
      <description>here's a script for you - &lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh&lt;BR /&gt;echo "enter the number you wish to look for"&lt;BR /&gt;read numb&lt;BR /&gt;cat number |&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;linumber=1&lt;BR /&gt;if [ $line = $numb ]&lt;BR /&gt;then&lt;BR /&gt;echo $linumber $numb&lt;BR /&gt;((linumber=$linumber+1))&lt;BR /&gt;elsif&lt;BR /&gt;((linumber=$linumber+1))&lt;BR /&gt;if&lt;BR /&gt;done</description>
      <pubDate>Tue, 13 May 2003 11:34:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971810#M120523</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-05-13T11:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help me the shell script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971811#M120524</link>
      <description>here's a script for you - &lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh&lt;BR /&gt;echo "enter the number you wish to look for"&lt;BR /&gt;read numb&lt;BR /&gt;cat number |&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;linumber=1&lt;BR /&gt;if [ $line = $numb ]&lt;BR /&gt;then&lt;BR /&gt;echo $linumber $numb&lt;BR /&gt;((linumber=$linumber+1))&lt;BR /&gt;elsif&lt;BR /&gt;((linumber=$linumber+1))&lt;BR /&gt;fi&lt;BR /&gt;done</description>
      <pubDate>Tue, 13 May 2003 11:35:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971811#M120524</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-05-13T11:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help me the shell script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971812#M120525</link>
      <description>sorry - My first post had a spelling mistake.... the 2nd to last line.... "if" should be "fi" - I corrected this in my second post</description>
      <pubDate>Tue, 13 May 2003 11:36:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971812#M120525</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-05-13T11:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Help me the shell script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971813#M120526</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I think the -n option to grep is what you're after; it'll print the line number of any lines found.&lt;BR /&gt;&lt;BR /&gt;Check the man page for grep(1) for more info.  In your script you'll want to use some error checking to cope with times when the number doesn't exist in the file.&lt;BR /&gt;&lt;BR /&gt;Please don't forget to assign points to people that have helped you; it helps others determine which answers are good; and helps reward people for their time and effort helping you.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Darren.</description>
      <pubDate>Tue, 13 May 2003 12:13:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971813#M120526</guid>
      <dc:creator>Darren Prior</dc:creator>
      <dc:date>2003-05-13T12:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help me the shell script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971814#M120527</link>
      <description>now I feel dumb :)  I should have remembered that instead of writting that script  :) oh well</description>
      <pubDate>Tue, 13 May 2003 13:01:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971814#M120527</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-05-13T13:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help me the shell script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971815#M120528</link>
      <description>John - don't forget there's a million ways to skin the Unix cat!  &lt;GRIN&gt;  Actually it's more common for me to post a script and see the next post contains a really quick, neat method. :)&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Darren.&lt;/GRIN&gt;</description>
      <pubDate>Tue, 13 May 2003 13:16:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-the-shell-script/m-p/2971815#M120528</guid>
      <dc:creator>Darren Prior</dc:creator>
      <dc:date>2003-05-13T13:16:11Z</dc:date>
    </item>
  </channel>
</rss>

