<?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 Change script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/change-script/m-p/5078762#M440033</link>
    <description>The below is the script to check the user no. , when user2 is login and run the script ($awk -F: -v me=$me '$1==me {print $2}' test.txt ) , the output is 2 .&lt;BR /&gt;$me=$(whoami)&lt;BR /&gt;$awk -F: -v me=$me '$1==me {print $2}' /tmp/test.txt   &lt;BR /&gt;$2&lt;BR /&gt;&lt;BR /&gt;The current test.txt is as below:&lt;BR /&gt;$vi  test.txt&lt;BR /&gt;user1:1&lt;BR /&gt;user2:2&lt;BR /&gt;user3:3&lt;BR /&gt;&lt;BR /&gt;now , if the test.txt is changed the format as below , can advise how to change my script to check the user no.&lt;BR /&gt;&lt;BR /&gt;$vi  /tmp/test.txt&lt;BR /&gt;user1 - 1&lt;BR /&gt;user2 - 2&lt;BR /&gt;user3 - 3</description>
    <pubDate>Wed, 07 Nov 2007 21:29:19 GMT</pubDate>
    <dc:creator>ust3</dc:creator>
    <dc:date>2007-11-07T21:29:19Z</dc:date>
    <item>
      <title>Change script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-script/m-p/5078762#M440033</link>
      <description>The below is the script to check the user no. , when user2 is login and run the script ($awk -F: -v me=$me '$1==me {print $2}' test.txt ) , the output is 2 .&lt;BR /&gt;$me=$(whoami)&lt;BR /&gt;$awk -F: -v me=$me '$1==me {print $2}' /tmp/test.txt   &lt;BR /&gt;$2&lt;BR /&gt;&lt;BR /&gt;The current test.txt is as below:&lt;BR /&gt;$vi  test.txt&lt;BR /&gt;user1:1&lt;BR /&gt;user2:2&lt;BR /&gt;user3:3&lt;BR /&gt;&lt;BR /&gt;now , if the test.txt is changed the format as below , can advise how to change my script to check the user no.&lt;BR /&gt;&lt;BR /&gt;$vi  /tmp/test.txt&lt;BR /&gt;user1 - 1&lt;BR /&gt;user2 - 2&lt;BR /&gt;user3 - 3</description>
      <pubDate>Wed, 07 Nov 2007 21:29:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-script/m-p/5078762#M440033</guid>
      <dc:creator>ust3</dc:creator>
      <dc:date>2007-11-07T21:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Change script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-script/m-p/5078763#M440034</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;do you have the space between the user and the number ?&lt;BR /&gt;-- if no space then replace the -F: with -F- and it should work , so the full line will be &lt;BR /&gt;&lt;BR /&gt;awk -F- -v me=$me '$1 == me { print $2}' /tmp/test1.txt&lt;BR /&gt;&lt;BR /&gt;otherwise try this -- if you want the space &lt;BR /&gt;&lt;BR /&gt;awk -v me=$me '$1==me {print $3}' /tmp/test.txt&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;RD</description>
      <pubDate>Wed, 07 Nov 2007 21:49:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-script/m-p/5078763#M440034</guid>
      <dc:creator>rajdev</dc:creator>
      <dc:date>2007-11-07T21:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Change script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-script/m-p/5078764#M440035</link>
      <description>thx much rajdev ,&lt;BR /&gt;&lt;BR /&gt;It works .&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Nov 2007 22:02:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-script/m-p/5078764#M440035</guid>
      <dc:creator>ust3</dc:creator>
      <dc:date>2007-11-07T22:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Change script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-script/m-p/5078765#M440036</link>
      <description>sorry to reopen the thread ,&lt;BR /&gt;&lt;BR /&gt;the script works fine ,&lt;BR /&gt;awk -v me=$me '$1==me {print $3}' /tmp/test.txt&lt;BR /&gt;&lt;BR /&gt;but I found if the test.txt have # sign as below , then there is no output , can advise how to change the script ? thx&lt;BR /&gt;&lt;BR /&gt;$vi /tmp/test.txt&lt;BR /&gt;#user1 - 1&lt;BR /&gt;#user2 - 2&lt;BR /&gt;#user3 - 3</description>
      <pubDate>Thu, 08 Nov 2007 01:42:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-script/m-p/5078765#M440036</guid>
      <dc:creator>ust3</dc:creator>
      <dc:date>2007-11-08T01:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Change script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-script/m-p/5078766#M440037</link>
      <description>thx all,&lt;BR /&gt;&lt;BR /&gt;I fixed it , please ignore the previous messages.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Nov 2007 05:54:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-script/m-p/5078766#M440037</guid>
      <dc:creator>ust3</dc:creator>
      <dc:date>2007-11-08T05:54:57Z</dc:date>
    </item>
  </channel>
</rss>

