<?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: Shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728868#M64922</link>
    <description>please  ignore my last comment of course the ^ will do it.&lt;BR /&gt;&lt;BR /&gt;John.</description>
    <pubDate>Wed, 22 May 2002 07:37:47 GMT</pubDate>
    <dc:creator>John Carr_2</dc:creator>
    <dc:date>2002-05-22T07:37:47Z</dc:date>
    <item>
      <title>Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728861#M64915</link>
      <description>Hi&lt;BR /&gt;I want to write a shell script that read a file and searches for lines beginning with # . I think I must use som kind of "pattern matching" (regular expression) but how do I get this work.</description>
      <pubDate>Wed, 22 May 2002 07:14:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728861#M64915</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2002-05-22T07:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728862#M64916</link>
      <description>cat /tmp/file.txt |grep "^#"</description>
      <pubDate>Wed, 22 May 2002 07:17:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728862#M64916</guid>
      <dc:creator>Sebastian Galeski_1</dc:creator>
      <dc:date>2002-05-22T07:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728863#M64917</link>
      <description>1. grep '^#' file&lt;BR /&gt;2. perl -ne 'm/^#/&amp;amp;&amp;amp;print' file</description>
      <pubDate>Wed, 22 May 2002 07:18:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728863#M64917</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-05-22T07:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728864#M64918</link>
      <description>Leif,&lt;BR /&gt;&lt;BR /&gt;cat &lt;FILE&gt; | grep ^#&lt;BR /&gt;&lt;BR /&gt;should be what you need.&lt;/FILE&gt;</description>
      <pubDate>Wed, 22 May 2002 07:18:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728864#M64918</guid>
      <dc:creator>Chris Wilshaw</dc:creator>
      <dc:date>2002-05-22T07:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728865#M64919</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;grep will do this for you...&lt;BR /&gt;&lt;BR /&gt;grep "^#" &lt;FILE&gt;&lt;BR /&gt;&lt;BR /&gt;will print all lines in &lt;FILE&gt; which start with #.&lt;BR /&gt;&lt;BR /&gt;If you want to process the lines in a script then you can write a shell script like this...&lt;BR /&gt;&lt;BR /&gt;grep "^#" &lt;FILE&gt; | {&lt;BR /&gt;while read LINE&lt;BR /&gt;do&lt;BR /&gt;&lt;PROCESS&gt;&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John&lt;BR /&gt;&lt;BR /&gt;&lt;/PROCESS&gt;&lt;/FILE&gt;&lt;/FILE&gt;&lt;/FILE&gt;</description>
      <pubDate>Wed, 22 May 2002 07:19:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728865#M64919</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2002-05-22T07:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728866#M64920</link>
      <description>hi,&lt;BR /&gt;you can try &lt;BR /&gt;#grep "#" filename&lt;BR /&gt;if you want more logic you can use awk&lt;BR /&gt;#man awk&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;U.SivaKumar</description>
      <pubDate>Wed, 22 May 2002 07:20:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728866#M64920</guid>
      <dc:creator>U.SivaKumar_2</dc:creator>
      <dc:date>2002-05-22T07:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728867#M64921</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;these first options will return every line containing a # you need to test the first character of each line to get it right.&lt;BR /&gt;&lt;BR /&gt;!#/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;for eachline in  filename ;&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;if [[ eachline[0] -eq "#" ]] then&lt;BR /&gt;     cat $eachline &amp;gt;&amp;gt; newfilename&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;cant remember the syntax on the if statement can someone correct it please.&lt;BR /&gt;&lt;BR /&gt;John.</description>
      <pubDate>Wed, 22 May 2002 07:31:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728867#M64921</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2002-05-22T07:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728868#M64922</link>
      <description>please  ignore my last comment of course the ^ will do it.&lt;BR /&gt;&lt;BR /&gt;John.</description>
      <pubDate>Wed, 22 May 2002 07:37:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2728868#M64922</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2002-05-22T07:37:47Z</dc:date>
    </item>
  </channel>
</rss>

