<?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: Help Needed for Script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948583#M103196</link>
    <description>Thankx guys,&lt;BR /&gt;&lt;BR /&gt;Now my script is working fine and once again thanks to all guys.&lt;BR /&gt;&lt;BR /&gt;Happy Christmas and New YEAR</description>
    <pubDate>Fri, 23 Dec 2005 06:48:50 GMT</pubDate>
    <dc:creator>Karthick K S</dc:creator>
    <dc:date>2005-12-23T06:48:50Z</dc:date>
    <item>
      <title>Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948566#M103179</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I write a one script for quit the application , if i quit the db it should comeout from telnet sessions itself and also CTRL-C should not work because only quit only can quit the session&lt;BR /&gt;&lt;BR /&gt;below the script i tried but if i quit its going to $ prompt and not comeout from telnet session&lt;BR /&gt;&lt;BR /&gt;pls help anyone&lt;BR /&gt;&lt;BR /&gt;dbcheck()&lt;BR /&gt;{&lt;BR /&gt;if [ $DB123 = "quit" ]&lt;BR /&gt;then&lt;BR /&gt;   clear&lt;BR /&gt;   exit 0&lt;BR /&gt;else&lt;BR /&gt;   getdb&lt;BR /&gt;fi&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;getdb()&lt;BR /&gt;{&lt;BR /&gt;clear&lt;BR /&gt;echo "\n\n\n\n\n&lt;BR /&gt;      Enter the db name you wish to connect to \n or quit to exit : \c"&lt;BR /&gt;read DB123&lt;BR /&gt;&lt;BR /&gt;dbcheck&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;getdb&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Dec 2005 00:44:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948566#M103179</guid>
      <dc:creator>Karthick K S</dc:creator>
      <dc:date>2005-12-23T00:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948567#M103180</link>
      <description>Hi Karthik, &lt;BR /&gt;&lt;BR /&gt;You can try two options, &lt;BR /&gt;&lt;BR /&gt;#1. Try logout, it will logout from script shell. &lt;BR /&gt;&lt;BR /&gt;#2. Create an alias for it, just like "./myscript.sh; exit"&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Fri, 23 Dec 2005 00:56:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948567#M103180</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2005-12-23T00:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948568#M103181</link>
      <description>Hi Arun,&lt;BR /&gt;&lt;BR /&gt;Can you give some example how to do</description>
      <pubDate>Fri, 23 Dec 2005 01:01:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948568#M103181</guid>
      <dc:creator>Karthick K S</dc:creator>
      <dc:date>2005-12-23T01:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948569#M103182</link>
      <description>To get out of telnet session you need to put in "exit" command.&lt;BR /&gt;&lt;BR /&gt;To disable operation of ^c, you need to set the trap to ignore ^c.&lt;BR /&gt;trep '' 3&lt;BR /&gt;3 is interrupt signal.</description>
      <pubDate>Fri, 23 Dec 2005 01:02:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948569#M103182</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-12-23T01:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948570#M103183</link>
      <description>dbcheck() &lt;BR /&gt;{ &lt;BR /&gt;if [ $DB123 = "quit" ] &lt;BR /&gt;then &lt;BR /&gt;clear &lt;BR /&gt;break&lt;BR /&gt;exit 0 &lt;BR /&gt;else &lt;BR /&gt;getdb &lt;BR /&gt;fi &lt;BR /&gt;} &lt;BR /&gt;logout # logout is quit is entered.&lt;BR /&gt;&lt;BR /&gt;getdb() &lt;BR /&gt;{ &lt;BR /&gt;trap '' 3 # to ignore the ^c&lt;BR /&gt;clear &lt;BR /&gt;echo "\n\n\n\n\n &lt;BR /&gt;Enter the db name you wish to connect to \n or quit to exit : \c" &lt;BR /&gt;read DB123 &lt;BR /&gt;&lt;BR /&gt;dbcheck &lt;BR /&gt;} &lt;BR /&gt;&lt;BR /&gt;getdb</description>
      <pubDate>Fri, 23 Dec 2005 01:09:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948570#M103183</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-12-23T01:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948571#M103184</link>
      <description>Hi Karthik, here is an example, &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://groups.google.com/group/comp.unix.questions/browse_thread/thread/7454d8d229e84167/09b8b71f5423e734?lnk=st&amp;amp;q=how+to+logout+from+a+shell+script%3F&amp;amp;rnum=1&amp;amp;hl=en#09b8b71f5423e734" target="_blank"&gt;http://groups.google.com/group/comp.unix.questions/browse_thread/thread/7454d8d229e84167/09b8b71f5423e734?lnk=st&amp;amp;q=how+to+logout+from+a+shell+script%3F&amp;amp;rnum=1&amp;amp;hl=en#09b8b71f5423e734&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Fri, 23 Dec 2005 01:09:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948571#M103184</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2005-12-23T01:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948572#M103185</link>
      <description>Hi RAC,&lt;BR /&gt;&lt;BR /&gt;Trap is not working pls help me if u hv example pls tell</description>
      <pubDate>Fri, 23 Dec 2005 01:23:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948572#M103185</guid>
      <dc:creator>Karthick K S</dc:creator>
      <dc:date>2005-12-23T01:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948573#M103186</link>
      <description>change trap command as follows and check.&lt;BR /&gt;trap "" 1 2 3 # to ignore trap signals 1 2 3</description>
      <pubDate>Fri, 23 Dec 2005 01:31:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948573#M103186</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-12-23T01:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948574#M103187</link>
      <description>Thanks RAC, &lt;BR /&gt;&lt;BR /&gt;Trap is working now my script is disabled the CTRL-C but how i should comeout from current telnet session thro' script</description>
      <pubDate>Fri, 23 Dec 2005 03:27:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948574#M103187</guid>
      <dc:creator>Karthick K S</dc:creator>
      <dc:date>2005-12-23T03:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948575#M103188</link>
      <description>Hi Karthik, &lt;BR /&gt;&lt;BR /&gt;You need to logout from the shell or kill it's PPID within the script. Take a look at the link which i have posted earlier on how to accomplish this. &lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Fri, 23 Dec 2005 03:38:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948575#M103188</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2005-12-23T03:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948576#M103189</link>
      <description>Yes Simply as,&lt;BR /&gt;&lt;BR /&gt;trap "exit;" 1 2 3 # to ignore trap signals 1 2 3&lt;BR /&gt;&lt;BR /&gt;It will execute exit command on getting signal 1 or 2 or 3.&lt;BR /&gt;&lt;BR /&gt;-Muthu</description>
      <pubDate>Fri, 23 Dec 2005 04:43:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948576#M103189</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-12-23T04:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948577#M103190</link>
      <description>You mean to say, when ^c, is pressed, you should get logout?? do it as follows then.&lt;BR /&gt;change trap statement as follows.&lt;BR /&gt;trap 'echo "logging out";logout' 1 2 3&lt;BR /&gt;&lt;BR /&gt;If you mean, when quit is entered, then it should logout, then do it as follows.&lt;BR /&gt;&lt;BR /&gt;dbcheck()&lt;BR /&gt;{&lt;BR /&gt;if [ $DB123 = "quit" ]&lt;BR /&gt;then&lt;BR /&gt;clear&lt;BR /&gt;breat #--&amp;gt;modified this.&lt;BR /&gt;else&lt;BR /&gt;getdb&lt;BR /&gt;fi&lt;BR /&gt;}&lt;BR /&gt;logout #--&amp;gt; modified this.</description>
      <pubDate>Fri, 23 Dec 2005 04:52:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948577#M103190</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-12-23T04:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948578#M103191</link>
      <description>You mean to say, when ^c, is pressed, you should get logout?? do it as follows then.&lt;BR /&gt;change trap statement as follows.&lt;BR /&gt;trap 'echo "logging out";logout' 1 2 3&lt;BR /&gt;&lt;BR /&gt;If you mean, when quit is entered, then it should logout, then do it as follows.&lt;BR /&gt;&lt;BR /&gt;dbcheck()&lt;BR /&gt;{&lt;BR /&gt;if [ $DB123 = "quit" ]&lt;BR /&gt;then&lt;BR /&gt;clear&lt;BR /&gt;break #--&amp;gt;modified this.&lt;BR /&gt;else&lt;BR /&gt;getdb&lt;BR /&gt;fi&lt;BR /&gt;}&lt;BR /&gt;logout #--&amp;gt; modified this.</description>
      <pubDate>Fri, 23 Dec 2005 04:52:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948578#M103191</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-12-23T04:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948579#M103192</link>
      <description>RAC,&lt;BR /&gt;&lt;BR /&gt;Replied twice. Is it one for new year greetings to karthik. ;)&lt;BR /&gt;&lt;BR /&gt;PS: Not relavent to post.&lt;BR /&gt;&lt;BR /&gt;Typing related with post---&amp;gt;&lt;BR /&gt;&lt;BR /&gt;You can execute a function or command with trap "part" &lt;SIGNAL&gt; information.&lt;BR /&gt;&lt;BR /&gt;-Muthu&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SIGNAL&gt;</description>
      <pubDate>Fri, 23 Dec 2005 04:59:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948579#M103192</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-12-23T04:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948580#M103193</link>
      <description>Thanks to all to give good information,&lt;BR /&gt;&lt;BR /&gt;But actually what i need CTRL-C should be disbled(this is working) and also if user quit the database and same time user should comeout from telnet sessions and user should never go to $ prompt</description>
      <pubDate>Fri, 23 Dec 2005 05:11:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948580#M103193</guid>
      <dc:creator>Karthick K S</dc:creator>
      <dc:date>2005-12-23T05:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948581#M103194</link>
      <description>May be like,&lt;BR /&gt;&lt;BR /&gt;dbcheck()&lt;BR /&gt;{&lt;BR /&gt;if [ $DB123 = "quit" ]&lt;BR /&gt;then&lt;BR /&gt;clear&lt;BR /&gt;# Killing that shell&lt;BR /&gt;kill -9 $(who -mu | awk '{ print $7;}')&lt;BR /&gt;else&lt;BR /&gt;getdb&lt;BR /&gt;fi&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Try it out.&lt;BR /&gt;&lt;BR /&gt;-Muthu&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Dec 2005 05:21:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948581#M103194</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-12-23T05:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948582#M103195</link>
      <description>Now I get it. The profile of user or something starts this menu (seperate shell script) So in shell script if user enters "quit", he should also logout from telnet session.&lt;BR /&gt;&lt;BR /&gt;Ok, we do it as follows.&lt;BR /&gt;Modify the function as follows.&lt;BR /&gt;&lt;BR /&gt;dbcheck()&lt;BR /&gt;{&lt;BR /&gt;if [ $DB123 = "quit" ]&lt;BR /&gt;then&lt;BR /&gt;clear&lt;BR /&gt;echo "${DB123}" &amp;gt; $HOME/.some_file&lt;BR /&gt;exit 0&lt;BR /&gt;else&lt;BR /&gt;getdb&lt;BR /&gt;fi&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Also modify the .profile/the script that starts the menu script as follows.&lt;BR /&gt;&lt;BR /&gt;exit_status_of_script=$(&amp;lt; ~/.some_file)&lt;BR /&gt;if [[ ${exit_status_of_script} = "quit" ]]&lt;BR /&gt;then&lt;BR /&gt;exit 0&lt;BR /&gt;else&lt;BR /&gt;continue&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Dec 2005 05:24:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948582#M103195</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-12-23T05:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed for Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948583#M103196</link>
      <description>Thankx guys,&lt;BR /&gt;&lt;BR /&gt;Now my script is working fine and once again thanks to all guys.&lt;BR /&gt;&lt;BR /&gt;Happy Christmas and New YEAR</description>
      <pubDate>Fri, 23 Dec 2005 06:48:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-script/m-p/4948583#M103196</guid>
      <dc:creator>Karthick K S</dc:creator>
      <dc:date>2005-12-23T06:48:50Z</dc:date>
    </item>
  </channel>
</rss>

