Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: issue with passing yes to the output of a command

by pme (Monsignor)
on Jul 26, 2015 at 14:16 UTC ( [id://1136355]=note: print w/replies, xml ) Need Help??


in reply to issue with passing yes to the output of a command

Using yes may help:
($out,$err) = $ssh->capture2("yes|cfgsave");

Replies are listed 'Best First'.
Re^2: issue with passing yes to the output of a command
by janasec (Sexton) on Jul 26, 2015 at 15:46 UTC

    tried above step

    ($out,$err) = $ssh->capture2("yes|cfgsave");

    getting error

    2015/07/27 02:38:56 saving the zone remote find command failed:child exited with code 248 at ./switchconfi +g.pl line 113, <$fh> line 4.
      It seems that 'cfgsave' passed the yes/no question, and looks like another issue. How does 'cfgsave' behave if you run manually?

        thanks guys i think adding "\" made the difference

        ($out,$err) = $ssh->capture2("zonecreate \"test1\", \"20:00:00:11:0d:3 +4:56:00\""); ($out,$err) = $ssh->capture2("echo yes\|cfgsave");

        thanks friends again for help

        DS_6505B:admin> cfgsave You are about to save the Defined zoning configuration. This action will only save the changes on Defined configuration. If the update includes changes to one or more traffic isolation zones, you must issue the 'cfgenable' command for the changes to take effect. Do you want to save the Defined zoning configuration only? (yes, y, n +o, n): [no] y Nothing changed: nothing to save, returning ...

        i need to pass yes after cfgsave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1136355]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-23 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found