<?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: yes or no in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014882#M96647</link>
    <description>Assuming POSIX shell:&lt;BR /&gt;&lt;BR /&gt;echo "This will erase demo with no backup. Continue? (y/[n]): \c"&lt;BR /&gt;read ANSWER&lt;BR /&gt;&lt;BR /&gt;case ${ANSWER} in&lt;BR /&gt;y|Y) rm whatever&lt;BR /&gt;     ;;&lt;BR /&gt;*) echo "Please have a backup run"&lt;BR /&gt;   ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;This assumes a "no" response for anything other than y or Y.</description>
    <pubDate>Mon, 20 Nov 2006 11:31:33 GMT</pubDate>
    <dc:creator>Jeff_Traigle</dc:creator>
    <dc:date>2006-11-20T11:31:33Z</dc:date>
    <item>
      <title>yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014881#M96646</link>
      <description>Good Morning All&lt;BR /&gt;&lt;BR /&gt;I just need a simple piece of code. Here is what I am trying to do &lt;BR /&gt;&lt;BR /&gt;I just want to prompt a user with "This will erase demo with no backup" Continue y or n. &lt;BR /&gt; y - results in a rm command&lt;BR /&gt; n - prompts &lt;BR /&gt;&lt;BR /&gt;"Please have a backup run" and kicks them to a prompt&lt;BR /&gt;&lt;BR /&gt;Any help would be great, sorry for the rookie question &lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 20 Nov 2006 11:24:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014881#M96646</guid>
      <dc:creator>P-Dicky</dc:creator>
      <dc:date>2006-11-20T11:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014882#M96647</link>
      <description>Assuming POSIX shell:&lt;BR /&gt;&lt;BR /&gt;echo "This will erase demo with no backup. Continue? (y/[n]): \c"&lt;BR /&gt;read ANSWER&lt;BR /&gt;&lt;BR /&gt;case ${ANSWER} in&lt;BR /&gt;y|Y) rm whatever&lt;BR /&gt;     ;;&lt;BR /&gt;*) echo "Please have a backup run"&lt;BR /&gt;   ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;This assumes a "no" response for anything other than y or Y.</description>
      <pubDate>Mon, 20 Nov 2006 11:31:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014882#M96647</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2006-11-20T11:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014883#M96648</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I use something like the following:&lt;BR /&gt;&lt;BR /&gt;echo "This will erase demo with no backup.  Continue y or n"&lt;BR /&gt;read ans&lt;BR /&gt;if [ $ans == yes ]; then&lt;BR /&gt;   rm command&lt;BR /&gt;else &lt;BR /&gt;   prompts&lt;BR /&gt;fi</description>
      <pubDate>Mon, 20 Nov 2006 11:34:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014883#M96648</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2006-11-20T11:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014884#M96649</link>
      <description>&lt;!--!*#--&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;You can adapt this to your needs:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset -l CHOICE&lt;BR /&gt;while true&lt;BR /&gt;do&lt;BR /&gt;  clear&lt;BR /&gt;  echo "\nThis will erase demo with no backup\n" &lt;BR /&gt;  echo "\n  &amp;gt;&amp;gt;&amp;gt; Enter &amp;lt; y &amp;gt; to remove"&lt;BR /&gt;  echo "\n  &amp;gt;&amp;gt;&amp;gt; Enter &amp;lt; n &amp;gt; to specify"&lt;BR /&gt;  echo "\n*---&amp;gt; \c"&lt;BR /&gt;  #&lt;BR /&gt;  read   CHOICE&lt;BR /&gt;  case ${CHOICE} in&lt;BR /&gt;    y ) echo "\nNow removing..."&lt;BR /&gt;        echo "press ENTER to resume"&lt;BR /&gt;        read REPLY&lt;BR /&gt;        continue &lt;BR /&gt;        ;;&lt;BR /&gt;    n ) exit&lt;BR /&gt;        ;;&lt;BR /&gt;    "") continue&lt;BR /&gt;        ;;&lt;BR /&gt;  esac&lt;BR /&gt;done&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 20 Nov 2006 11:37:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014884#M96649</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-11-20T11:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014885#M96650</link>
      <description>Jeff &lt;BR /&gt;&lt;BR /&gt;It is not wrapping my text (I changed it a little. I am getting this &lt;BR /&gt;&lt;BR /&gt;and: &lt;BR /&gt;&lt;BR /&gt;How can I get it to split to the next line?</description>
      <pubDate>Mon, 20 Nov 2006 12:00:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014885#M96650</guid>
      <dc:creator>P-Dicky</dc:creator>
      <dc:date>2006-11-20T12:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014886#M96651</link>
      <description>Here is what I have &lt;BR /&gt;&lt;BR /&gt;cp /fpc/oracle/8.0.6/network/admin/listener.ora /drp/demofiles&lt;BR /&gt;cp /fpc/oracle/8.0.6/network/admin/tnsnames.ora /drp/demofiles&lt;BR /&gt;echo "This will erase prod 32 demo with no backup. It will also bring down test5&lt;BR /&gt;4 and prod40. Continue? (y/[n]:\c"&lt;BR /&gt;read ANSWER&lt;BR /&gt;case ${ANSWER} in&lt;BR /&gt;y|Y ps -ef | grep oracle | grep -v grep | awk '{print $2}' | xargs kill -9&lt;BR /&gt;cd /fpc&lt;BR /&gt;rm -rf *&lt;BR /&gt;;;&lt;BR /&gt;*) echo "Please have a backup run"&lt;BR /&gt;;;&lt;BR /&gt;esac</description>
      <pubDate>Mon, 20 Nov 2006 12:02:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014886#M96651</guid>
      <dc:creator>P-Dicky</dc:creator>
      <dc:date>2006-11-20T12:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014887#M96652</link>
      <description>&lt;!--!*#--&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;PS3='This will erase demo with no backup (Pick 1-3)? '&lt;BR /&gt;   select i in "y" "n" "*"&lt;BR /&gt;   do&lt;BR /&gt;       case $i in&lt;BR /&gt;              "y"|"Y") echo Will run the rm command&lt;BR /&gt;                       break&lt;BR /&gt;                       ;;&lt;BR /&gt;              "n"|"N") echo Please have a backup run!!!&lt;BR /&gt;                       exit&lt;BR /&gt;                       ;;&lt;BR /&gt;                  "*") echo "Bye Bye..."&lt;BR /&gt;                       sleep 2&lt;BR /&gt;                       exit&lt;BR /&gt;                       ;;&lt;BR /&gt;       esac&lt;BR /&gt;   done&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Nov 2006 12:26:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014887#M96652</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-11-20T12:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014888#M96653</link>
      <description>"echo" doesn't understand how to wrap text, so you need to break it yourself.&lt;BR /&gt;Something like the following:&lt;BR /&gt;&lt;BR /&gt;WAS:&lt;BR /&gt;echo "This will erase prod 32 demo with no backup. It will also bring down test5&lt;BR /&gt;4 and prod40. Continue? (y/[n]:\c"&lt;BR /&gt;&lt;BR /&gt;TRY:&lt;BR /&gt;echo "This will erase prod 32 demo with no backup. It will also bring "&lt;BR /&gt;echo "down test54 and prod40. Continue? (y/[n]:\c"&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Nov 2006 12:26:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014888#M96653</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2006-11-20T12:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014889#M96654</link>
      <description>or stick a \n anywhere you want a new-line&lt;BR /&gt;&lt;BR /&gt;ie.&lt;BR /&gt;&lt;BR /&gt;echo "abc\ndef"&lt;BR /&gt;&lt;BR /&gt;will produce&lt;BR /&gt;abc&lt;BR /&gt;def</description>
      <pubDate>Mon, 20 Nov 2006 12:28:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014889#M96654</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2006-11-20T12:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014890#M96655</link>
      <description>Good Morning, &lt;BR /&gt;&lt;BR /&gt;So this is what I have so far&lt;BR /&gt;&lt;BR /&gt;cp /fpc/oracle/8.0.6/network/admin/listener.ora /drp/demofiles&lt;BR /&gt;cp /fpc/oracle/8.0.6/network/admin/tnsnames.ora /drp/demofiles&lt;BR /&gt;echo "This will erase prod 32 demo with no backup. It will also bring down\n tes&lt;BR /&gt;t54 and prod40. Continue? (y/[n]): \c"&lt;BR /&gt;read ANSWER&lt;BR /&gt;if [$ANSWER ==y ]; then&lt;BR /&gt;        ps -ef | grep oracle | grep -v grep | awk '{print $2}' | xargs kill -9&lt;BR /&gt;        cd /fpc&lt;BR /&gt;        rm -rf *&lt;BR /&gt;else&lt;BR /&gt;echo "Please have a backup run"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;And this is what it is doing &lt;BR /&gt;&lt;BR /&gt;# ./s1.sh &lt;BR /&gt;This will erase prod 32 demo with no backup. It will also bring down&lt;BR /&gt; test54 and prod40. Continue? (y/[n]): y&lt;BR /&gt;./s1.sh[5]: [y:  not found.&lt;BR /&gt;Please have a backup run&lt;BR /&gt;[root:demoglo:/drp]&lt;BR /&gt;# &lt;BR /&gt;&lt;BR /&gt;Any tips would be great... Thanks&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Nov 2006 07:30:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014890#M96655</guid>
      <dc:creator>P-Dicky</dc:creator>
      <dc:date>2006-11-22T07:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014891#M96656</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You need whitespace around the brackets:&lt;BR /&gt;&lt;BR /&gt;# if [ $ANSWER = "y" ]; then&lt;BR /&gt;&lt;BR /&gt;You also need to use "=" since this is the shell's test for string equality.&lt;BR /&gt;&lt;BR /&gt;*ALSO* do yourself a favor:  NEVER use 'rm -rf' uness you are dead sure that you are removing what you think you are!  In this script, at least, do:&lt;BR /&gt;&lt;BR /&gt;# cd /fpc &amp;amp;&amp;amp; rm -rf *&lt;BR /&gt;&lt;BR /&gt;...in this way, *only* if the directory '/fpc' exists and you successfully change into it will the 'rm' be executed.  The way you coded you script would mean a missing '/fpc' directory would leave your PATH wherever it was when you ran the script.  If you were at the root directory as root, well, you just gave yourself a chance to practice a full server rebuild!&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 22 Nov 2006 07:44:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014891#M96656</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-11-22T07:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014892#M96657</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;instead of:&lt;BR /&gt;if [$ANSWER ==y ]; then&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;try:&lt;BR /&gt;if [ $ANSWER = "Y" -o $ANSWER = "y" ] ; then &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Wed, 22 Nov 2006 07:52:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014892#M96657</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-11-22T07:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014893#M96658</link>
      <description>hi again,&lt;BR /&gt;&lt;BR /&gt;as mentioned by JRF above, pay attention to the whitespaces.&lt;BR /&gt;&lt;BR /&gt;you may wish to copy it from my last post and paste it in your script.&lt;BR /&gt;&lt;BR /&gt;CAUTION!&lt;BR /&gt;========&lt;BR /&gt;above all, when testing your script, disable the actual command inside the scripts! only use echo commands&lt;BR /&gt;&lt;BR /&gt;good luck&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Nov 2006 07:56:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014893#M96658</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-11-22T07:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014894#M96659</link>
      <description>Thank you.. I'll be back!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Nov 2006 07:58:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014894#M96659</guid>
      <dc:creator>P-Dicky</dc:creator>
      <dc:date>2006-11-22T07:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014895#M96660</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;Instead of testing for lowercase and uppercase letters, add  'typeset -l' declaration thusyly:&lt;BR /&gt;&lt;BR /&gt;# typeset -l ANSWER&lt;BR /&gt;...&lt;BR /&gt;# read ANSWER&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;This automatically converts all uppercase letters to lowercase ones when the assignment is made.  Hence you can respond in uppercase and test only lowercase letters.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF....</description>
      <pubDate>Wed, 22 Nov 2006 07:59:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014895#M96660</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-11-22T07:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: yes or no</title>
      <link>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014896#M96661</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;One other comment: using a kill -9 to shutdown a database is almost guaranteed to corrupt your database somewhere down the line.  &lt;BR /&gt;&lt;BR /&gt;If you read the man page on kill(1), you will see that the -9 switch means unconditional, cannot-be-ignored kill.  This means that the process has not time to close files and clean up after itself.&lt;BR /&gt;&lt;BR /&gt;Why not use the init.d script to shut down the DB in an orderly manner?&lt;BR /&gt;&lt;BR /&gt;Just my 2cts,&lt;BR /&gt;&lt;BR /&gt;Mark</description>
      <pubDate>Wed, 22 Nov 2006 12:44:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/yes-or-no/m-p/5014896#M96661</guid>
      <dc:creator>Mark Ellzey</dc:creator>
      <dc:date>2006-11-22T12:44:17Z</dc:date>
    </item>
  </channel>
</rss>

