<?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: scripting question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870181#M707239</link>
    <description>never mind..i fixed it,  i think i'm coming down with dinner fixation.. no lunch... *sigh anyways, thanks for your help!! I really appreciate this!!  &lt;BR /&gt;&lt;BR /&gt;but I will have one more question about scripting... after switching user and successfully logging in, there is a process that needs to be ran that will ask for rfid and user id and I need these two things to be prompted before the process executes... should this be written in that actual script or can that be done seperately... any suggestions?</description>
    <pubDate>Thu, 11 Nov 2004 19:02:42 GMT</pubDate>
    <dc:creator>Deoncia Grayson_1</dc:creator>
    <dc:date>2004-11-11T19:02:42Z</dc:date>
    <item>
      <title>scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870167#M707225</link>
      <description>Proglem: I'm creating a menu and within the menu one of the options should switch user and ask for a password before executing the next command how would I do this?</description>
      <pubDate>Thu, 11 Nov 2004 15:20:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870167#M707225</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-11-11T15:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870168#M707226</link>
      <description>Hi Deonicia,&lt;BR /&gt;&lt;BR /&gt;I assume you are using case statement. I would do like this&lt;BR /&gt;&lt;BR /&gt;case $something in&lt;BR /&gt;&lt;BR /&gt;"opt1") &lt;BR /&gt;some_commands&lt;BR /&gt;;;&lt;BR /&gt;"opt2")&lt;BR /&gt;echo "Enter the password for user"&lt;BR /&gt;su - user1 -c "&lt;BR /&gt;command1&lt;BR /&gt;command2&lt;BR /&gt;command3"&lt;BR /&gt;;;&lt;BR /&gt;*) echo "invalid choice"&lt;BR /&gt;;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;If the option is "opt2", then it will switch user to user1 and then execute the commands enclosed in "". SU itself will ask for the password so you don't have write steps for it.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Thu, 11 Nov 2004 15:32:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870168#M707226</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-11-11T15:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870169#M707227</link>
      <description>something like this:&lt;BR /&gt;&lt;BR /&gt;VALID=0&lt;BR /&gt;while [ $VALID -ne 1 ]; do&lt;BR /&gt;&lt;BR /&gt;echo "Enter user name to become:\c"&lt;BR /&gt;read USERNAME&lt;BR /&gt;VALID=`grep -c "^$USERNAME" /etc/passwd`&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;su - $USERNAME&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;which will switch to the user requested, prompting for the user's password--unless being performed as root or that user.&lt;BR /&gt;&lt;BR /&gt;mark</description>
      <pubDate>Thu, 11 Nov 2004 15:35:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870169#M707227</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2004-11-11T15:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870170#M707228</link>
      <description>Hi,&lt;BR /&gt;an example of a menu where you have to supply the oracle user's pw for option no. 2, unless you are root:&lt;BR /&gt;&lt;BR /&gt;PS3="Enter item: "&lt;BR /&gt;select choice in ls date quit&lt;BR /&gt;do&lt;BR /&gt;case $REPLY&lt;BR /&gt;in&lt;BR /&gt;1) ls;;&lt;BR /&gt;2) su oracle -c date;;&lt;BR /&gt;3|O|q) exit ;;&lt;BR /&gt;*) echo "Invalid choice" ;;&lt;BR /&gt;esac&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Thu, 11 Nov 2004 15:42:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870170#M707228</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2004-11-11T15:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870171#M707229</link>
      <description>clear &lt;BR /&gt;print "Catalyst Script MENU" &lt;BR /&gt;PS3="Test Menu, enter choice:" &lt;BR /&gt;select clean_menu in "Verify Catalyst Packages" "Set Maintenance Flag on Catalys&lt;BR /&gt;t" "Clearing Maintenance Flag on Catalyst" "Reset RF for Deal Instance on Cataly&lt;BR /&gt;st" "Reset RF for Main Instance in Catalyst" "Exit" &lt;BR /&gt;do &lt;BR /&gt;case $clean_menu in &lt;BR /&gt;"Verify Catalyst Packages") &lt;BR /&gt;/usr/sbin/cmviewcl;; &lt;BR /&gt;&lt;BR /&gt;"Set Maintenance Flag on Catalyst") &lt;BR /&gt;/apps/bin/set_cat_maint_mode;; &lt;BR /&gt;&lt;BR /&gt;"Clearing Maintenance Flag on Catalyst") &lt;BR /&gt;/apps/bin/clr_cat_maint_mode;; &lt;BR /&gt;&lt;BR /&gt;"Reset RF for Deal Instance on Catalsyst")&lt;BR /&gt;echo "Enter the password for user"&lt;BR /&gt;su - root;;&lt;BR /&gt;&lt;BR /&gt;an example of the script i'm using and when i choose option 4 it doesn't do anything.</description>
      <pubDate>Thu, 11 Nov 2004 15:46:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870171#M707229</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-11-11T15:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870172#M707230</link>
      <description>Hi Deoncia,&lt;BR /&gt;&lt;BR /&gt;Couple of problems in your script.&lt;BR /&gt;&lt;BR /&gt;1. Correct the string "catalsyst" in option4.&lt;BR /&gt;2. Add option5 and option 6 also like&lt;BR /&gt;&lt;BR /&gt;"Reset RF for Deal Instance on Catalyst")&lt;BR /&gt;echo "Enter the password for user"&lt;BR /&gt;su - root;;&lt;BR /&gt;"Reset RF for Main Instance in Catalyst"&lt;BR /&gt;some_function;;&lt;BR /&gt;"Exit")&lt;BR /&gt;exit;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;The text has to match exactly... otherwise it won't work.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Thu, 11 Nov 2004 17:03:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870172#M707230</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-11-11T17:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870173#M707231</link>
      <description>Hey Sri, &lt;BR /&gt;&lt;BR /&gt;Thanks for heads up on the typo; however now I'm getting a syntax error on my Exit line. Its saying `) is unexpected.</description>
      <pubDate>Thu, 11 Nov 2004 17:24:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870173#M707231</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-11-11T17:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870174#M707232</link>
      <description>Looks like you copy-pasted my lines.. That was only to show you the modifications - not to copy them exactly.. Let me try then..&lt;BR /&gt;&lt;BR /&gt;"Reset RF for Deal Instance on Catalyst")&lt;BR /&gt;echo "Enter the password for user"&lt;BR /&gt;su - root;;&lt;BR /&gt;"Reset RF for Main Instance in Catalyst")&lt;BR /&gt;some_function;;&lt;BR /&gt;"Exit")&lt;BR /&gt;exit;;&lt;BR /&gt;*)&lt;BR /&gt;echo "invalid option";;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;You will need to fill in "some_function".&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Thu, 11 Nov 2004 17:28:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870174#M707232</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-11-11T17:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870175#M707233</link>
      <description>Hey Sri,&lt;BR /&gt;&lt;BR /&gt;Thanks for the help thus far, really appreciate it; however, one more question, on option five I need to su to another user id and when I plugged that option in, I'm receiving invalid option.  &lt;BR /&gt;&lt;BR /&gt;"Reset RF for Deal Instance on Catalyst")&lt;BR /&gt;echo "Enter the password for Deal"&lt;BR /&gt;su - deal;;&lt;BR /&gt;&lt;BR /&gt;"Reset RF for Main Instance on Catalyst")&lt;BR /&gt;echo "Enter the password for Main"&lt;BR /&gt;su - main;;&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Nov 2004 17:49:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870175#M707233</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-11-11T17:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870176#M707234</link>
      <description>Can you post the the script from 'select' until 'done' again?. Looks like there are some more mismatches.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Thu, 11 Nov 2004 18:22:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870176#M707234</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-11-11T18:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870177#M707235</link>
      <description>select clean_menu in "Verify Catalyst Packages" "Set Maintenance Flag on Catalys&lt;BR /&gt;t" "Clearing Maintenance Flag on Catalyst" "Reset RF for Deal Instance on Cataly&lt;BR /&gt;st" "Reset RF for Main Instance in Catalyst" "Exit" &lt;BR /&gt;do &lt;BR /&gt;case $clean_menu in &lt;BR /&gt;"Verify Catalyst Packages") &lt;BR /&gt;/usr/sbin/cmviewcl;; &lt;BR /&gt;&lt;BR /&gt;"Set Maintenance Flag on Catalyst") &lt;BR /&gt;/apps/bin/set_cat_maint_mode;; &lt;BR /&gt;&lt;BR /&gt;"Clearing Maintenance Flag on Catalyst") &lt;BR /&gt;/apps/bin/clr_cat_maint_mode;; &lt;BR /&gt;&lt;BR /&gt;"Reset RF for Deal Instance on Catalyst")&lt;BR /&gt;echo "Enter the password for Deal"&lt;BR /&gt;su - deal;;&lt;BR /&gt;&lt;BR /&gt;"Reset RF for Main Instance on Catalyst")&lt;BR /&gt;echo "Enter the password for Main"&lt;BR /&gt;su - main;;&lt;BR /&gt;&lt;BR /&gt;"Exit")&lt;BR /&gt;exit;;&lt;BR /&gt;*)&lt;BR /&gt;echo "invalid option";;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Nov 2004 18:26:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870177#M707235</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-11-11T18:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870178#M707236</link>
      <description>OK. Here are the problems.&lt;BR /&gt;&lt;BR /&gt;1. Modify the entire "select" phrase to one line. Or add "\" for better readability.&lt;BR /&gt;2. Change "Reset RF for Main Instance in Catalyst" in the select line to "Reset RF for Main Instance on Catalyst". As I said, we need to make sure these lines match exactly in select and in case statements. After modifying them, I got it like&lt;BR /&gt;&lt;BR /&gt;//start&lt;BR /&gt;select clean_menu in \&lt;BR /&gt;"Verify Catalyst Packages" \&lt;BR /&gt;"Set Maintenance Flag on Catalyst" \&lt;BR /&gt;"Clearing Maintenance Flag on Catalyst" \&lt;BR /&gt;"Reset RF for Deal Instance on Catalyst" \&lt;BR /&gt;"Reset RF for Main Instance on Catalyst" \&lt;BR /&gt;"Exit"&lt;BR /&gt;do&lt;BR /&gt;case $clean_menu in&lt;BR /&gt;"Verify Catalyst Packages")&lt;BR /&gt;/usr/sbin/cmviewcl;;&lt;BR /&gt;&lt;BR /&gt;"Set Maintenance Flag on Catalyst")&lt;BR /&gt;/apps/bin/set_cat_maint_mode;;&lt;BR /&gt;&lt;BR /&gt;"Clearing Maintenance Flag on Catalyst")&lt;BR /&gt;/apps/bin/clr_cat_maint_mode;;&lt;BR /&gt;&lt;BR /&gt;"Reset RF for Deal Instance on Catalyst")&lt;BR /&gt;echo "Enter the password for Deal"&lt;BR /&gt;su - deal;;&lt;BR /&gt;&lt;BR /&gt;"Reset RF for Main Instance on Catalyst")&lt;BR /&gt;echo "Enter the password for Main"&lt;BR /&gt;su - main;;&lt;BR /&gt;&lt;BR /&gt;"Exit")&lt;BR /&gt;exit;;&lt;BR /&gt;*)&lt;BR /&gt;echo "invalid option";;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;//end&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Thu, 11 Nov 2004 18:44:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870178#M707236</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-11-11T18:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870179#M707237</link>
      <description>Hey Sri,&lt;BR /&gt;&lt;BR /&gt;Thanks for your help!! Now I'm just being annoying.. how do you get rid of the pound sign that shows up in front of the question mark, when i excecute my script, it brings up the menu but instead of just a question mark asking for my options I get...&lt;BR /&gt;#?&lt;BR /&gt;&lt;BR /&gt;please help...</description>
      <pubDate>Thu, 11 Nov 2004 18:52:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870179#M707237</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-11-11T18:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870180#M707238</link>
      <description>You are supposed to replace the original part in your script. So, add these three lines just above the script.&lt;BR /&gt;&lt;BR /&gt;clear&lt;BR /&gt;print "Catalyst Script MENU"&lt;BR /&gt;PS3="Test Menu, enter choice:" &lt;BR /&gt;&lt;BR /&gt;It's PS3 that gives you the prompt. By default it is #?&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Nov 2004 18:55:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870180#M707238</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-11-11T18:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870181#M707239</link>
      <description>never mind..i fixed it,  i think i'm coming down with dinner fixation.. no lunch... *sigh anyways, thanks for your help!! I really appreciate this!!  &lt;BR /&gt;&lt;BR /&gt;but I will have one more question about scripting... after switching user and successfully logging in, there is a process that needs to be ran that will ask for rfid and user id and I need these two things to be prompted before the process executes... should this be written in that actual script or can that be done seperately... any suggestions?</description>
      <pubDate>Thu, 11 Nov 2004 19:02:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870181#M707239</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-11-11T19:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870182#M707240</link>
      <description>Do you have to provide the arguments for the process or it itself will prompt?. In the first case, you will have write couple of lines to get that information in advance. For ex.,&lt;BR /&gt;&lt;BR /&gt;"Reset RF for Deal Instance on Catalyst")&lt;BR /&gt;printf "Enter the rfid:"&lt;BR /&gt;read rfid&lt;BR /&gt;printf "Enter the user:"&lt;BR /&gt;read user&lt;BR /&gt;echo "Enter the password for Deal"&lt;BR /&gt;su - deal -c "&lt;BR /&gt;your_process $rfid $user&lt;BR /&gt;"&lt;BR /&gt;&lt;BR /&gt;In the second case, all you have to do is to specify the process as an argument to "-c" and it will prompt itself.&lt;BR /&gt;&lt;BR /&gt;I may go offline for sometime. But, continue to post and someone may answer your questions.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Thu, 11 Nov 2004 19:26:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870182#M707240</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-11-11T19:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870183#M707241</link>
      <description>thanks to everyone who contributed to this post. Sri, big thanks to you!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Nov 2004 14:50:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/4870183#M707241</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-11-12T14:50:41Z</dc:date>
    </item>
  </channel>
</rss>

