<?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: Shell Script in non-prompt mode in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860496#M96003</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;For this command, there's the -f option as already pointed out.  When the command doesn't have an option, most can be scripted by using "here-document" syntax.  You simply redirect standard input from the script.  Example:&lt;BR /&gt;&lt;BR /&gt;command &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;y&lt;BR /&gt;&lt;BR /&gt;something&lt;BR /&gt;something else&lt;BR /&gt;n&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;In this example, "y" is passed as input the first time "command" expects input.  The second time, a null response is input (the blank line is just as if you entered CR from the keyboard).  The third time "something" is input.  And so on...&lt;BR /&gt;&lt;BR /&gt;For here-documents, there are to be no leading spaces for any input line nor the ending "word" (EOF in this example).  You can use leading tabs if you specify the here-document by using &amp;lt;&amp;lt;- instead of &amp;lt;&amp;lt;.  Also, EOF isn't special.  You can use any word.  See man sh-posix for more info.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
    <pubDate>Tue, 10 Dec 2002 01:46:08 GMT</pubDate>
    <dc:creator>Darrell Allen</dc:creator>
    <dc:date>2002-12-10T01:46:08Z</dc:date>
    <item>
      <title>Shell Script in non-prompt mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860493#M96000</link>
      <description>&lt;BR /&gt;How do I get place the script in non-interactive mode so that it automatically answers "y" and hits carriage return after each prompt instead of waiting for a user input. Please look the script below.&lt;BR /&gt;&lt;BR /&gt;===========================================&lt;BR /&gt;for i in `vgdisplay -v vgtest| egrep "LV Name"|awk '{print $NF}'`&lt;BR /&gt;do&lt;BR /&gt;lvreduce $i&lt;BR /&gt;done&lt;BR /&gt;==============================================&lt;BR /&gt;&lt;BR /&gt;I get the following prompt after before LV removal. &lt;BR /&gt;=====================&lt;BR /&gt;The logical volume "/dev/vgtest/lvol1" is not empty;&lt;BR /&gt;do you really want to delete the logical volume (y/n) :&lt;BR /&gt;&lt;BR /&gt;========================&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Dec 2002 19:08:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860493#M96000</guid>
      <dc:creator>Sammy_2</dc:creator>
      <dc:date>2002-12-09T19:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script in non-prompt mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860494#M96001</link>
      <description>use 'lvreduce -f'.&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Dec 2002 19:10:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860494#M96001</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2002-12-09T19:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script in non-prompt mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860495#M96002</link>
      <description>It's not the shell script, it's each of the individual commands. So you will need to use the "-f" option for lvreduce, and other options (if available) for other commands. Or else use "expect" or pipe the required characters into the command.&lt;BR /&gt;&lt;BR /&gt;Tom</description>
      <pubDate>Mon, 09 Dec 2002 19:35:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860495#M96002</guid>
      <dc:creator>Tom Maloy</dc:creator>
      <dc:date>2002-12-09T19:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script in non-prompt mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860496#M96003</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;For this command, there's the -f option as already pointed out.  When the command doesn't have an option, most can be scripted by using "here-document" syntax.  You simply redirect standard input from the script.  Example:&lt;BR /&gt;&lt;BR /&gt;command &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;y&lt;BR /&gt;&lt;BR /&gt;something&lt;BR /&gt;something else&lt;BR /&gt;n&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;In this example, "y" is passed as input the first time "command" expects input.  The second time, a null response is input (the blank line is just as if you entered CR from the keyboard).  The third time "something" is input.  And so on...&lt;BR /&gt;&lt;BR /&gt;For here-documents, there are to be no leading spaces for any input line nor the ending "word" (EOF in this example).  You can use leading tabs if you specify the here-document by using &amp;lt;&amp;lt;- instead of &amp;lt;&amp;lt;.  Also, EOF isn't special.  You can use any word.  See man sh-posix for more info.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Tue, 10 Dec 2002 01:46:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860496#M96003</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-12-10T01:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script in non-prompt mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860497#M96004</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Just for information because you've got some good answers already (-f option of lvreduce and redirecting input using &amp;lt;&amp;lt;), but there is also a funny tool that you can use when you need a lot of 'y' answer. It's 'yes', which sends 'y' followed by a linefeed repeatedly (or any other string if you want). So just pipe it to your script :&lt;BR /&gt;&lt;BR /&gt;yes | rm -i a b&lt;BR /&gt;&lt;BR /&gt;will answer yes to all suppress confirmation (I know that in this case 'rm a b' would be better :^) ).&lt;BR /&gt;&lt;BR /&gt;Or&lt;BR /&gt;&lt;BR /&gt;yes good | foo&lt;BR /&gt;&lt;BR /&gt;will answer good to all foo inputs.&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Tue, 10 Dec 2002 07:05:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860497#M96004</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2002-12-10T07:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script in non-prompt mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860498#M96005</link>
      <description>from the man page.&lt;BR /&gt;&lt;BR /&gt;      lvreduce cannot be performed if the volume group is activated in shared mode.&lt;BR /&gt;&lt;BR /&gt;Even if you get feed the y to the program if you try it in certain circumstances it will squawk.&lt;BR /&gt;&lt;BR /&gt;more&lt;BR /&gt;      lvreduce asks for confirmation before deallocating logical extents if&lt;BR /&gt;      the -f option is omitted.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;redundant post? Perhaps.&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Dec 2002 14:17:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860498#M96005</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2002-12-10T14:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script in non-prompt mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860499#M96006</link>
      <description>Thanks All.&lt;BR /&gt;Jean- your suggestion works on rm command&lt;BR /&gt;but when I do a lvremove on LV &lt;BR /&gt;y | lvremove /dev/vgmass/lvol1&lt;BR /&gt;it gives me "Bad Input Parameter"&lt;BR /&gt;Darrell-yours worked perfectly with the EOF script&lt;BR /&gt;Steve, Tom, Pat, thanks to all with lvreduce option but I was looking for an option to be used with other commands as well.</description>
      <pubDate>Tue, 10 Dec 2002 15:13:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860499#M96006</guid>
      <dc:creator>Sammy_2</dc:creator>
      <dc:date>2002-12-10T15:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script in non-prompt mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860500#M96007</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;Strange, I give you the execution on my system :&lt;BR /&gt;&lt;BR /&gt;/.root# lvcreate -L 12 vg00            &lt;BR /&gt;Logical volume "/dev/vg00/lvol13" has been successfully created with character device "/dev/vg00/rlvol13".&lt;BR /&gt;Logical volume "/dev/vg00/lvol13" has been successfully extended.&lt;BR /&gt;Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf&lt;BR /&gt;/.root# yes | lvremove /dev/vg00/lvol13&lt;BR /&gt;The logical volume "/dev/vg00/lvol13" is not empty;&lt;BR /&gt;do you really want to delete the logical volume (y/n) : Logical volume "/dev/vg00/lvol13" has been successfully removed.&lt;BR /&gt;Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf&lt;BR /&gt;&lt;BR /&gt;So it seems to work, but I use 'yes', not 'y'. Anyway it was just for fun because in your case I would also have redirected input using &amp;lt;&amp;lt; :^)&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Tue, 10 Dec 2002 15:20:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-in-non-prompt-mode/m-p/2860500#M96007</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2002-12-10T15:20:22Z</dc:date>
    </item>
  </channel>
</rss>

