<?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: matching a regexp in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001814#M98301</link>
    <description>&lt;!--!*#--&gt;big thanks Denis,&lt;BR /&gt;&lt;BR /&gt;$OS_PATTERN works very fine ;)&lt;BR /&gt;&lt;BR /&gt;my problem is solved, big thanks all for your help.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;PS:&lt;BR /&gt;"-a os_release" does not seems to work as expected beacause the result needs to be piped by grep in all manner:&lt;BR /&gt;$ swlist -v -s /depot/PHCO_27779.depot -a os_release&lt;BR /&gt;# Initializing...&lt;BR /&gt;# Contacting target "nr0u0169"...&lt;BR /&gt;#&lt;BR /&gt;# swlist   Depot Table of Contents&lt;BR /&gt;#&lt;BR /&gt;# For depot:  nr0u0169:/depot/PHCO_27779.depot&lt;BR /&gt;#&lt;BR /&gt;# Date:  Fri Sep  8 10:12:40 2006&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;#&lt;BR /&gt;# No Bundle(s) on nr0u0169:/depot/PHCO_27779.depot&lt;BR /&gt;# Product(s):&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;  PHCO_27779&lt;BR /&gt;vendor&lt;BR /&gt;product&lt;BR /&gt;os_release             B.11.00&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 08 Sep 2006 03:16:56 GMT</pubDate>
    <dc:creator>totoperdu</dc:creator>
    <dc:date>2006-09-08T03:16:56Z</dc:date>
    <item>
      <title>matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001805#M98292</link>
      <description>&lt;!--!*#--&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;i want to auto install depots from many hosts, when i launch (for example):&lt;BR /&gt;swlist -v -s depot_path/file.depot |grep "^os_release "&lt;BR /&gt;&lt;BR /&gt;the result is:&lt;BR /&gt;os_release             ?.11.*&lt;BR /&gt;&lt;BR /&gt;someone know how i could match $(uname -r) with "?.11.*" in a script ?&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;&lt;BR /&gt;Cedrick Gaillard.</description>
      <pubDate>Thu, 07 Sep 2006 12:08:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001805#M98292</guid>
      <dc:creator>totoperdu</dc:creator>
      <dc:date>2006-09-07T12:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001806#M98293</link>
      <description>you can pass string like B.11.11 directly in the script to check os_release</description>
      <pubDate>Thu, 07 Sep 2006 12:30:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001806#M98293</guid>
      <dc:creator>IT_2007</dc:creator>
      <dc:date>2006-09-07T12:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001807#M98294</link>
      <description>Hi Cedrick:&lt;BR /&gt;&lt;BR /&gt;# uname -r | sed -n '/11\..*/p'&lt;BR /&gt;&lt;BR /&gt;...returns non-enpty output if matched.  Does that help?&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 07 Sep 2006 12:42:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001807#M98294</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-09-07T12:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001808#M98295</link>
      <description>tro match the exact format, you can try:&lt;BR /&gt;&lt;BR /&gt;count=`uname -r|grep -Ec ".[.]11[.].*"`&lt;BR /&gt;&lt;BR /&gt;or if you just care for ".11." try this:&lt;BR /&gt;&lt;BR /&gt;count=`uname -r|grep -c ".11."`&lt;BR /&gt;&lt;BR /&gt;Then use $count in your if conditions... (shud be '1' if the OS is ?.11.*)</description>
      <pubDate>Thu, 07 Sep 2006 12:54:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001808#M98295</guid>
      <dc:creator>Srini Jay</dc:creator>
      <dc:date>2006-09-07T12:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001809#M98296</link>
      <description>Cedrick,&lt;BR /&gt;&lt;BR /&gt;How about something like...&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;cd /depot_path&lt;BR /&gt;for f in $(ls -1 $PWD/*$(uname -r | cut -d. -f2-3)*)&lt;BR /&gt;do&lt;BR /&gt;  swinstall -s ${f} \*&lt;BR /&gt;done&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Thu, 07 Sep 2006 13:08:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001809#M98296</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-09-07T13:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001810#M98297</link>
      <description># REV=$(uname -r)&lt;BR /&gt;&lt;BR /&gt;# echo $REV | awk '$0~/^.\.11\..*$/'&lt;BR /&gt;OR&lt;BR /&gt;# echo $REV | grep ".\.11\.*"&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Sep 2006 13:45:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001810#M98297</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-09-07T13:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001811#M98298</link>
      <description>&lt;!--!*#--&gt;sorry i'm not at work for now (i can't test) but nothing seems to be what i want to do.&lt;BR /&gt;&lt;BR /&gt;the result of 'swlist -v -s depot_path/file.depot |grep "^os_release "' could be:&lt;BR /&gt;?.11.* or ?.1[10].* or anithing else.&lt;BR /&gt;&lt;BR /&gt;the result of 'uname -r' could be:&lt;BR /&gt;A.11.00 or B.11.23 or anything else.&lt;BR /&gt;&lt;BR /&gt;i have tried to do something of simple:&lt;BR /&gt;echo 'B.11.11' |grep -E '?.11.*'&lt;BR /&gt;&lt;BR /&gt;but that seems to work only on GNU grep ;(&lt;BR /&gt;hpux grep don't know the '?' char and i can't install GNU grep on all servers i want to auto-install the depots.&lt;BR /&gt;&lt;BR /&gt;when i have started to write this auto-install script, i have renamed the original depots under the form:&lt;BR /&gt;$(uname -r).${PA_or_IA}$(getconf KERNEL_BITS).${softname}.depot&lt;BR /&gt;&lt;BR /&gt;with that, i have create symlink for all versions supported by the depot but it's very dirty.&lt;BR /&gt;i did it temporary, until i finish to read the SD-UX documentation and the only way i found for something of clean is to extract the informations from the depot, so, i must deduct the name of the good package by interrogating all depots that matches the $softname var.&lt;BR /&gt;&lt;BR /&gt;thanks.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Cedrick Gaillard.</description>
      <pubDate>Thu, 07 Sep 2006 15:57:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001811#M98298</guid>
      <dc:creator>totoperdu</dc:creator>
      <dc:date>2006-09-07T15:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001812#M98299</link>
      <description>&amp;gt;echo 'B.11.11' |grep -E '?.11.*'&lt;BR /&gt;&lt;BR /&gt;try this...&lt;BR /&gt;&lt;BR /&gt;# echo 'B.11.11' | grep "^[A-Z]\.11\.[0-9][0-9]$"&lt;BR /&gt;OR&lt;BR /&gt;# echo 'B.11.11' | grep "^[A-Z]\.11\.[0-9]\{2\}$"&lt;BR /&gt;&lt;BR /&gt;hope it helps!</description>
      <pubDate>Thu, 07 Sep 2006 16:23:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001812#M98299</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-09-07T16:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001813#M98300</link>
      <description>(Note you can use "-a os_release" instead of -v and grep.)&lt;BR /&gt;&lt;BR /&gt;I assume you want to use the value of os_release to see if it matches your OS version.  If so, given OS_PATTERN="?.11.*", you can use shell pattern matching inside of [[ ]]:&lt;BR /&gt;   if [[ "$(uname -r)" = $OS_PATTERN ]]; then echo TRUE; else echo FALSE; fi&lt;BR /&gt;&lt;BR /&gt;If you want to use grep/awk regular expressions, you can change the "." to "\." and then "?" to ".":&lt;BR /&gt;XX=$(echo "?.11.2*" | sed -e 's/\./\\./g' -e 's/?/./g')</description>
      <pubDate>Thu, 07 Sep 2006 17:40:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001813#M98300</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-09-07T17:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001814#M98301</link>
      <description>&lt;!--!*#--&gt;big thanks Denis,&lt;BR /&gt;&lt;BR /&gt;$OS_PATTERN works very fine ;)&lt;BR /&gt;&lt;BR /&gt;my problem is solved, big thanks all for your help.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;PS:&lt;BR /&gt;"-a os_release" does not seems to work as expected beacause the result needs to be piped by grep in all manner:&lt;BR /&gt;$ swlist -v -s /depot/PHCO_27779.depot -a os_release&lt;BR /&gt;# Initializing...&lt;BR /&gt;# Contacting target "nr0u0169"...&lt;BR /&gt;#&lt;BR /&gt;# swlist   Depot Table of Contents&lt;BR /&gt;#&lt;BR /&gt;# For depot:  nr0u0169:/depot/PHCO_27779.depot&lt;BR /&gt;#&lt;BR /&gt;# Date:  Fri Sep  8 10:12:40 2006&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;#&lt;BR /&gt;# No Bundle(s) on nr0u0169:/depot/PHCO_27779.depot&lt;BR /&gt;# Product(s):&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;  PHCO_27779&lt;BR /&gt;vendor&lt;BR /&gt;product&lt;BR /&gt;os_release             B.11.00&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Sep 2006 03:16:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001814#M98301</guid>
      <dc:creator>totoperdu</dc:creator>
      <dc:date>2006-09-08T03:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001815#M98302</link>
      <description>&amp;gt;"-a os_release" does not seems to work as expected because the result needs to be piped by grep in all manner:&lt;BR /&gt;$ swlist -v -s /depot/PHCO_27779.depot -a os_release&lt;BR /&gt;&lt;BR /&gt;When you use -a, you should remove the -v:&lt;BR /&gt;$ /usr/sbin/swlist -a os_release&lt;BR /&gt;# Bundle(s):&lt;BR /&gt;  B3693AA             ?.11.2*&lt;BR /&gt;  B3901BA             B.11.2[23]|B.11.31</description>
      <pubDate>Fri, 08 Sep 2006 03:41:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001815#M98302</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-09-08T03:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001816#M98303</link>
      <description>&lt;!--!*#--&gt;it's identical, the result needs to be piped:&lt;BR /&gt;$ swlist -s /depot/PHCO_27779.depot -a os_release&lt;BR /&gt;# Initializing...&lt;BR /&gt;# Contacting target "nr0u0169"...&lt;BR /&gt;#&lt;BR /&gt;# Target: nr0u0169:/depot/PHCO_27779.depot&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;#&lt;BR /&gt;# No Bundle(s) on nr0u0169:/depot/PHCO_27779.depot&lt;BR /&gt;# Product(s):&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;PHCO_27779 B.11.00</description>
      <pubDate>Fri, 08 Sep 2006 05:14:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001816#M98303</guid>
      <dc:creator>totoperdu</dc:creator>
      <dc:date>2006-09-08T05:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001817#M98304</link>
      <description>Hi Cedrick,&lt;BR /&gt;this run on Hp-UX:&lt;BR /&gt;echo 'B.11.11' |grep -E '(.)*\.11\.(.)*'&lt;BR /&gt;&lt;BR /&gt;(.)*=? in your example&lt;BR /&gt;\. to be sure to look for . (. it's a wildcard)&lt;BR /&gt;(.)*=* in your example&lt;BR /&gt;&lt;BR /&gt;in general (.)* means any number of chars&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Fri, 08 Sep 2006 09:03:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001817#M98304</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2006-09-08T09:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001818#M98305</link>
      <description>Hi Cedrick,&lt;BR /&gt;if you need more info:&lt;BR /&gt;man 5 regexp&lt;BR /&gt;Hth,&lt;BR /&gt;Art</description>
      <pubDate>Fri, 08 Sep 2006 09:09:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001818#M98305</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2006-09-08T09:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: matching a regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001819#M98306</link>
      <description>hello Art,&lt;BR /&gt;&lt;BR /&gt;my problem is solved.&lt;BR /&gt;&lt;BR /&gt;thanks for your input.</description>
      <pubDate>Fri, 08 Sep 2006 10:08:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/matching-a-regexp/m-p/5001819#M98306</guid>
      <dc:creator>totoperdu</dc:creator>
      <dc:date>2006-09-08T10:08:23Z</dc:date>
    </item>
  </channel>
</rss>

