<?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 Korn Help: need to enter two &amp;quot;y&amp;quot;s onto a command in a script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6811864#M494769</link>
    <description>&lt;P&gt;I have a script and it will be basically repeating to run a command on a lot of different parameters, then this command requires to enter two "y"s, and then enter after each "y".&lt;/P&gt;&lt;P&gt;What can I do to allow the script to enter a "y", and then RETRUN, then one more "y" again, then RETURN?&lt;/P&gt;&lt;P&gt;Tried differnet ways, but could not figure that out. Appreciate your help!&lt;/P&gt;</description>
    <pubDate>Tue, 17 Nov 2015 21:02:48 GMT</pubDate>
    <dc:creator>Hanry Zhou</dc:creator>
    <dc:date>2015-11-17T21:02:48Z</dc:date>
    <item>
      <title>Korn Help: need to enter two "y"s onto a command in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6811864#M494769</link>
      <description>&lt;P&gt;I have a script and it will be basically repeating to run a command on a lot of different parameters, then this command requires to enter two "y"s, and then enter after each "y".&lt;/P&gt;&lt;P&gt;What can I do to allow the script to enter a "y", and then RETRUN, then one more "y" again, then RETURN?&lt;/P&gt;&lt;P&gt;Tried differnet ways, but could not figure that out. Appreciate your help!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 21:02:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6811864#M494769</guid>
      <dc:creator>Hanry Zhou</dc:creator>
      <dc:date>2015-11-17T21:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Korn Help: need to enter two "y"s onto a command in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6811905#M494770</link>
      <description>&lt;P&gt;&amp;gt; I have a script and it will be basically [...]&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; With my weak psychic powers, I can't see your script, and what it&lt;BR /&gt;"basically" does is probably much less important than what it _actually_&lt;BR /&gt;does.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] Appreciate your help!&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Perhaps, but you might waste less of everyone's time if you didn't&lt;BR /&gt;make your readers guess what you're doing.&amp;nbsp; As usual, showing actual&lt;BR /&gt;commands with their actual output can be more helpful than vague&lt;BR /&gt;descriptions or interpretations.&amp;nbsp; Examples of useless descriptions:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run a command on a lot of different parameters&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this command&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to enter a "y"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Tried [different] ways&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; For a good time, try a Web search for:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; how to ask a technical question&lt;BR /&gt;Then, do some reading.&amp;nbsp; Then, try asking a question which a non-psychic&lt;BR /&gt;might have some chance of being able to answer.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 00:23:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6811905#M494770</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2015-11-18T00:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Korn Help: need to enter two "y"s onto a command in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6812059#M494771</link>
      <description>&lt;P&gt;There is a program in HP-UX called &lt;FONT color="#993300"&gt;&lt;STRONG&gt;yes&lt;/STRONG&gt;&lt;/FONT&gt;. (see: &lt;FONT color="#993300"&gt;&lt;STRONG&gt;man yes&lt;/STRONG&gt;&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;Since there are no details about how you are asking the question in the script, you'll have to figure out how to connect the &lt;FONT color="#993300"&gt;&lt;STRONG&gt;yes&lt;/STRONG&gt; &lt;/FONT&gt;program to the question. If your script only expects the "&lt;FONT color="#993300"&gt;&lt;STRONG&gt;y&lt;/STRONG&gt;&lt;/FONT&gt;" then you can feed the answers like this:&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;yes |&amp;nbsp;script_name &amp;lt;commandLine_stuff&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;or&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;yes | head -2 | script_name &amp;lt;commandLine_stuff&amp;gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;BTW: to see it working:&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;$ yes | head -2
y
y
$ yes no | head -3
no
no
no&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 13:36:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6812059#M494771</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2015-11-18T13:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: KSH Help: need to enter two "y"s onto a command in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6812155#M494772</link>
      <description>&lt;P&gt;You could also use a here-doc where you supply the input:&lt;/P&gt;&lt;P&gt;script &amp;lt;&amp;lt;EOF&lt;/P&gt;&lt;P&gt;inputs ...&lt;/P&gt;&lt;P&gt;EOF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unless you quote the EOF word, $ expansions are done in your inputs.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 18:02:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6812155#M494772</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2015-11-18T18:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: KSH Help: need to enter two "y"s onto a command in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6812192#M494773</link>
      <description>&lt;P&gt;cat sani.sh&lt;BR /&gt;for i in `cat list`&lt;BR /&gt;do&lt;BR /&gt;ssh user_id@ip&amp;nbsp;command&amp;nbsp;op1 opt2&amp;nbsp;-c 6 $i&lt;BR /&gt;done&lt;/P&gt;&lt;P&gt;to beigining with, I just did one interactive execution, and it doesn't work.&lt;/P&gt;&lt;P&gt;$ yes | head -2 | ssh user_id@ip&amp;nbsp;command&amp;nbsp;op1 opt2&amp;nbsp;-c 6 0a.16&lt;/P&gt;&lt;P&gt;Would you like to continue (y/n)? Please answer yes or no.&lt;BR /&gt;Would you like to continue (y/n)?&lt;/P&gt;&lt;P&gt;It did not accept what being fed.&lt;/P&gt;&lt;P&gt;Hope it is clear this time. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 19:51:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6812192#M494773</guid>
      <dc:creator>Hanry Zhou</dc:creator>
      <dc:date>2015-11-18T19:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: KSH Help: need to enter two "y"s onto a command in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6812226#M494774</link>
      <description>&lt;P&gt;&amp;gt; to beigining with, I just did one interactive execution, [...]&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; That's a good way to start.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; $ yes | head -2 | ssh user_id@ip command op1 opt2 -c 6 0a.16&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; What happens without the "yes | head -2 | " part?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Would you like to continue (y/n)? Please answer yes or no.&lt;BR /&gt;&amp;gt; Would you like to continue (y/n)?&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; It did not accept what being fed.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; From here, it's not clear who "It" is.&amp;nbsp; Are the "Would you like to&lt;BR /&gt;continue" questions coming from "ssh" or from "command" (whatever that&lt;BR /&gt;might be)?&amp;nbsp; If you "ssh" (as "user_id") to "ip", can you make "command&lt;BR /&gt;[...]" work interactively?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Hope it is clear this time.&amp;nbsp; [...]&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Better, but not good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; It might be helpful if you said what the operating system at "ip" is,&lt;BR /&gt;and what "command" is. If the program which is asking the questions is&lt;BR /&gt;not reading from stdin, then you may not be able to pipe data into it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; There may be other ways to make this kind of thing work, but with no&lt;BR /&gt;real information on what "this kind of thing" actually is, you're asking&lt;BR /&gt;for more guesswork (again).&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 21:36:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6812226#M494774</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2015-11-18T21:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: KSH Help: need to enter two "y"s onto a command in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6812234#M494775</link>
      <description>&lt;P&gt;If the remote end is HP-UX, then you might try something like this instead:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ssh user_id@ip yes | head -2 | command&amp;nbsp;op1 opt2&amp;nbsp;-c 6 0a.16&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This way the "yes" is run on the destination rather than the source.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But that's just a shot in the dark since we're not sure about the destination.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 22:06:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6812234#M494775</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2015-11-18T22:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: KSH Help: need to enter two "y"s onto a command in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6812240#M494776</link>
      <description>&lt;P&gt;&amp;gt; ssh user_id@ip yes | head -2 | command op1 opt2 -c 6 0a.16&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; This way the "yes" is run on the destination rather than the source.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Unfortunately, that way, "yes" is the _only_ thing which is run on&lt;BR /&gt;the remote system.&amp;nbsp; For example (on a Mac or two):&lt;BR /&gt;&lt;BR /&gt;mba$ uname -n&lt;BR /&gt;mba.local&lt;BR /&gt;&lt;BR /&gt;mba$ ssh pro3 pwd | uname -n&lt;BR /&gt;mba.local&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; With some quotation, more of the pipeline can be run on the remote&lt;BR /&gt;system:&lt;BR /&gt;&lt;BR /&gt;mba$ ssh pro3 'pwd | uname -n'&lt;BR /&gt;pro3.antinode.info&lt;/P&gt;&lt;P&gt;&amp;gt; But that's just a shot in the dark since we're not sure about the&lt;BR /&gt;&amp;gt; destination.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Among many other things about which we have no useful information.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 23:24:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6812240#M494776</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2015-11-18T23:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: KSH Help: need to enter two "y"s onto a command in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6813077#M494777</link>
      <description>&lt;P&gt;Try using ssh -n to prevent stdin from being eaten up:&lt;/P&gt;&lt;P&gt;for host in $(&amp;lt; list); do&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ssh -n user_id@ip&amp;nbsp;command&amp;nbsp;op1 opt2&amp;nbsp;-c 6 $host&lt;BR /&gt;done&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need that yes(1) solution, you would need to put it inside the ssh command pipeline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2015 22:16:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-help-need-to-enter-two-quot-y-quot-s-onto-a-command-in-a/m-p/6813077#M494777</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2015-11-21T22:16:20Z</dc:date>
    </item>
  </channel>
</rss>

