<?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: Script question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4006406#M298147</link>
    <description>Shalom&lt;BR /&gt;&lt;BR /&gt;snippet&lt;BR /&gt;&lt;BR /&gt;echo "Do you want to proceed y/n "&lt;BR /&gt;read proceed&lt;BR /&gt;&lt;BR /&gt;if [ "$proceed" == "y" ]&lt;BR /&gt;then&lt;BR /&gt;   echo "delete data&lt;BR /&gt;   # delete data&lt;BR /&gt;else&lt;BR /&gt;   echo "doing nothing, have a nice day"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;</description>
    <pubDate>Thu, 24 May 2007 06:30:43 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2007-05-24T06:30:43Z</dc:date>
    <item>
      <title>Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4006405#M298146</link>
      <description>&lt;BR /&gt;How do I work with a command in a script that prompts for a Yes or No?&lt;BR /&gt;&lt;BR /&gt;This is the command that waits for user input-&lt;BR /&gt;johnsonr@nmsccm01 &amp;gt;  /opt/CSCOpx/campus/bin/reinitdb.pl&lt;BR /&gt;This will erase all data from the database. Are you sure [y/n] ?&lt;BR /&gt;&lt;BR /&gt;I want to answer y in the script below.  How can I accomplish this?&lt;BR /&gt;****************************************&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;#set date variables&lt;BR /&gt;my_yr=`date +%y`&lt;BR /&gt;my_mon=`date +%b`&lt;BR /&gt;my_day=`date +%d`&lt;BR /&gt;my_hr=`date +%H`&lt;BR /&gt;my_min=`date +M`&lt;BR /&gt;&lt;BR /&gt;my_date="$my_yr$my_mon$my_day"&lt;BR /&gt;&lt;BR /&gt;#make backup of the ANIServer.properties file&lt;BR /&gt;cp /opt/CSCOpx/campus/etc/cwsi/ANIServer.properties /opt/CSCOpx/campus/etc/cwsi/ANIServer.properties.23May07&lt;BR /&gt;&lt;BR /&gt;#copy new ANIServer.properties file&lt;BR /&gt;cp /tmp/ANIServer.new /opt/CSCOpx/campus/etc/cwsi/ANIServer.properties&lt;BR /&gt;&lt;BR /&gt;#Reinitialize the ANI Database&lt;BR /&gt;/opt/CSCOpx/campus/bin/reinitdb.pl&lt;BR /&gt;***********************************************</description>
      <pubDate>Thu, 24 May 2007 06:21:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4006405#M298146</guid>
      <dc:creator>Rob Johnson_3</dc:creator>
      <dc:date>2007-05-24T06:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4006406#M298147</link>
      <description>Shalom&lt;BR /&gt;&lt;BR /&gt;snippet&lt;BR /&gt;&lt;BR /&gt;echo "Do you want to proceed y/n "&lt;BR /&gt;read proceed&lt;BR /&gt;&lt;BR /&gt;if [ "$proceed" == "y" ]&lt;BR /&gt;then&lt;BR /&gt;   echo "delete data&lt;BR /&gt;   # delete data&lt;BR /&gt;else&lt;BR /&gt;   echo "doing nothing, have a nice day"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;</description>
      <pubDate>Thu, 24 May 2007 06:30:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4006406#M298147</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-05-24T06:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4006407#M298148</link>
      <description>Hi Rob,&lt;BR /&gt;&lt;BR /&gt;two ways:&lt;BR /&gt;first:&lt;BR /&gt;# echo y | /opt/CSCOpx/campus/bin/reinitdb.pl&lt;BR /&gt;&lt;BR /&gt;second:&lt;BR /&gt;# /opt/CSCOpx/campus/bin/reinitdb.pl &amp;lt;&lt;EOC&gt;&lt;/EOC&gt;y&lt;BR /&gt;EOC&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Both give "y" to the program so it can continue.&lt;BR /&gt;&lt;BR /&gt;rgds&lt;BR /&gt;HGH&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 24 May 2007 06:54:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4006407#M298148</guid>
      <dc:creator>Hemmetter</dc:creator>
      <dc:date>2007-05-24T06:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4006408#M298149</link>
      <description>In regards to both SEP's and HGH's solutions, you may want to check to see if the script is interactive, and then not ask.&lt;BR /&gt;&lt;BR /&gt;You can use tty(1):&lt;BR /&gt;$ if tty -s; then echo it is a tty; fi</description>
      <pubDate>Fri, 25 May 2007 01:01:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4006408#M298149</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-05-25T01:01:54Z</dc:date>
    </item>
  </channel>
</rss>

