<?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: &amp;quot;&amp;quot; help in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976072#M99330</link>
    <description>Hi Fernando,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if you want to distinguish between three cases, try something like this, using your file as $1:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;LINE=$(grep OPERATOR $1)&lt;BR /&gt;REST=${LINE##OPERATOR,}&lt;BR /&gt;&lt;BR /&gt;echo "$REST" | grep -q "\"\"" 1&amp;gt;/dev/null&lt;BR /&gt;if [ "$?" = "0" ]&lt;BR /&gt;then&lt;BR /&gt;        content=quoutes&lt;BR /&gt;else&lt;BR /&gt;        echo "$REST" | grep -q "[0-9]" 1&amp;gt;/dev/null&lt;BR /&gt;        if [ "$?" = "0" ]&lt;BR /&gt;        then&lt;BR /&gt;                content=numbers&lt;BR /&gt;        else&lt;BR /&gt;                # if no number present, assume string&lt;BR /&gt;                content=string&lt;BR /&gt;        fi&lt;BR /&gt;fi&lt;BR /&gt;echo $content&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;</description>
    <pubDate>Fri, 28 Apr 2006 05:41:36 GMT</pubDate>
    <dc:creator>john korterman</dc:creator>
    <dc:date>2006-04-28T05:41:36Z</dc:date>
    <item>
      <title>"" help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976067#M99325</link>
      <description>Dear Gurus,&lt;BR /&gt;&lt;BR /&gt;I have file with the following content&lt;BR /&gt;&lt;BR /&gt;....&lt;BR /&gt;OPERATOR,""&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;Sometimes, this field contains numbers.&lt;BR /&gt;What i would like to do is test the content if&lt;BR /&gt;it is "" or a number or string.&lt;BR /&gt;&lt;BR /&gt;Maximum points to all correct answers.&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Apr 2006 04:20:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976067#M99325</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2006-04-28T04:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: "" help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976068#M99326</link>
      <description>You mean to say that sometimes OPERATOR,"" (without double quotes) there might be a number and you want to test that?</description>
      <pubDate>Fri, 28 Apr 2006 04:29:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976068#M99326</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-04-28T04:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: "" help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976069#M99327</link>
      <description>Fernando,&lt;BR /&gt;if you assume a file format of:&lt;BR /&gt;Operator,""&lt;BR /&gt;Operator,"alpha"&lt;BR /&gt;Operator,"Alpha"&lt;BR /&gt;Operator,"123"&lt;BR /&gt;&lt;BR /&gt;running the script:&lt;BR /&gt;&lt;BR /&gt;# /usr/bin/sh&lt;BR /&gt;while read record&lt;BR /&gt;do&lt;BR /&gt;data=`echo $record | cut -d',' -f2|tr -d '"'`&lt;BR /&gt;echo "[$data]"&lt;BR /&gt;case ${data} in&lt;BR /&gt;[0-9]*) echo valid number entered&lt;BR /&gt;;;&lt;BR /&gt;[a-z]*) echo valid string entered&lt;BR /&gt;;;&lt;BR /&gt;[A-Z]*) echo valid string entered&lt;BR /&gt;;;&lt;BR /&gt;*) echo empty data&lt;BR /&gt;;;&lt;BR /&gt;esac&lt;BR /&gt;done &amp;lt; d.dat&lt;BR /&gt;&lt;BR /&gt;Gives you:&lt;BR /&gt;[]&lt;BR /&gt;empty data&lt;BR /&gt;[alpha]&lt;BR /&gt;valid string entered&lt;BR /&gt;[Alpha]&lt;BR /&gt;valid string entered&lt;BR /&gt;[123]&lt;BR /&gt;valid number entered&lt;BR /&gt;&lt;BR /&gt;Beware this script only checks the first character of the data given, so 1a2 would give you a number return !</description>
      <pubDate>Fri, 28 Apr 2006 04:48:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976069#M99327</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-04-28T04:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: "" help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976070#M99328</link>
      <description>Do you mean like this?&lt;BR /&gt;if [ -z "$OP" ]&lt;BR /&gt;  then echo "its empty"&lt;BR /&gt;  else&lt;BR /&gt;    if [ $OP -eq 0 ]&lt;BR /&gt;       then echo "its a zero"&lt;BR /&gt;       else echo "Its not a zero"&lt;BR /&gt;    fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[dba]blprd:/home/dba&amp;gt;OP=""&lt;BR /&gt;[dba]blprd:/home/dba&amp;gt; if [ -z "$OP" ] ^J  then echo "its empty" ^J  else^J    if [ $OP -eq 0 ] ^J       then e&amp;gt;&lt;BR /&gt;its empty&lt;BR /&gt;[dba]blprd:/home/dba&amp;gt; OP=123&lt;BR /&gt;[dba]blprd:/home/dba&amp;gt; if [ -z "$OP" ] ^J  then echo "its empty" ^J  else^J    if [ $OP -eq 0 ] ^J       then e&amp;gt;&lt;BR /&gt;Its not a zero&lt;BR /&gt;[dba]blprd:/home/dba&amp;gt; OP=0&lt;BR /&gt;[dba]blprd:/home/dba&amp;gt; if [ -z "$OP" ] ^J  then echo "its empty" ^J  else^J    if [ $OP -eq 0 ] ^J       then e&amp;gt;&lt;BR /&gt;its a zero&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Apr 2006 04:49:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976070#M99328</guid>
      <dc:creator>Steve Lewis</dc:creator>
      <dc:date>2006-04-28T04:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: "" help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976071#M99329</link>
      <description>var=$(grep ^'OPERATOR\,\"\"' your_file|awk -F '\,' {print $2}')&lt;BR /&gt;if [ $(echo ${var}|tr -d '[0-9]') = "" ];then&lt;BR /&gt;echo "Yes, contains number"&lt;BR /&gt;else&lt;BR /&gt;echo "No number"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Apr 2006 05:10:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976071#M99329</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-04-28T05:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: "" help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976072#M99330</link>
      <description>Hi Fernando,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if you want to distinguish between three cases, try something like this, using your file as $1:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;LINE=$(grep OPERATOR $1)&lt;BR /&gt;REST=${LINE##OPERATOR,}&lt;BR /&gt;&lt;BR /&gt;echo "$REST" | grep -q "\"\"" 1&amp;gt;/dev/null&lt;BR /&gt;if [ "$?" = "0" ]&lt;BR /&gt;then&lt;BR /&gt;        content=quoutes&lt;BR /&gt;else&lt;BR /&gt;        echo "$REST" | grep -q "[0-9]" 1&amp;gt;/dev/null&lt;BR /&gt;        if [ "$?" = "0" ]&lt;BR /&gt;        then&lt;BR /&gt;                content=numbers&lt;BR /&gt;        else&lt;BR /&gt;                # if no number present, assume string&lt;BR /&gt;                content=string&lt;BR /&gt;        fi&lt;BR /&gt;fi&lt;BR /&gt;echo $content&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Apr 2006 05:41:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976072#M99330</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2006-04-28T05:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: "" help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976073#M99331</link>
      <description>Thanks the help. :-)&lt;BR /&gt;This forum is really great!</description>
      <pubDate>Mon, 01 May 2006 21:16:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/quot-quot-help/m-p/4976073#M99331</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2006-05-01T21:16:10Z</dc:date>
    </item>
  </channel>
</rss>

