Mailing List Archive

Using commands with clogin that require confirmation
Hi,

I am trying to script (using clogin) various commands, one of which is
'clear counters'. This unfortunately requires a confirmation that
doesn't appear to be disableable.

Is there any way to force clogin to, fx, wait 1 second, hit enter, and
_then_ expect the prompt again? I've tried various combinations of -c
'clear count;;' but it doesn't seem to send anything until it has seen
a new prompt.

Thanks,
Ras
Using commands with clogin that require confirmation [ In reply to ]
On (2005-10-03 16:09 +0100), Jee Kay wrote:

> Is there any way to force clogin to, fx, wait 1 second, hit enter, and
> _then_ expect the prompt again? I've tried various combinations of -c
> 'clear count;;' but it doesn't seem to send anything until it has seen
> a new prompt.

Waiting probably doesn't work, but \r should work. You should have
all in one line, until you're back in the prompt.

--
++ytti
Using commands with clogin that require confirmation [ In reply to ]
Using "\n" has worked for us. The following is an example showing an
ACL being uploaded via the interactive prompts on a 6509 running native IOS:

-c "conf net\nhost\n192.168.1.1\nACL/123-routergw1.ip\n;wr mem"

Dave

Saku Ytti wrote:
> On (2005-10-03 16:09 +0100), Jee Kay wrote:
>
>> Is there any way to force clogin to, fx, wait 1 second, hit enter, and
>> _then_ expect the prompt again? I've tried various combinations of -c
>> 'clear count;;' but it doesn't seem to send anything until it has seen
>> a new prompt.
>
> Waiting probably doesn't work, but \r should work. You should have
> all in one line, until you're back in the prompt.
>
Using commands with clogin that require confirmation [ In reply to ]
On (2005-10-03 11:29 -0400), David LaPorte wrote:

> Using "\n" has worked for us. The following is an example showing an
> ACL being uploaded via the interactive prompts on a 6509 running native IOS:
>
> -c "conf net\nhost\n192.168.1.1\nACL/123-routergw1.ip\n;wr mem"

This was not asked, but canonical way to separate commands is ';'.

--
++ytti
Using commands with clogin that require confirmation [ In reply to ]
We had no luck descending through the interactive prompts with ";". The
changing prompt was likely the issue, I assume

Saku Ytti wrote:
> On (2005-10-03 11:29 -0400), David LaPorte wrote:
>
>> Using "\n" has worked for us. The following is an example showing an
>> ACL being uploaded via the interactive prompts on a 6509 running native IOS:
>>
>> -c "conf net\nhost\n192.168.1.1\nACL/123-routergw1.ip\n;wr mem"
>
> This was not asked, but canonical way to separate commands is ';'.
>
Using commands with clogin that require confirmation [ In reply to ]
On (2005-10-03 11:29 -0400), David LaPorte wrote:

> Using "\n" has worked for us. The following is an example showing an
> ACL being uploaded via the interactive prompts on a 6509 running native IOS:
>
> -c "conf net\nhost\n192.168.1.1\nACL/123-routergw1.ip\n;wr mem"

Sorry my hasty posting, I misread your command, and indeed \n works
as well as \r.
Now I only have to wonder why I thought it didn't, as I'm sure I tried
it first when I had same problem :)

--
++ytti