GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Perl to send cntl c and cntl d
Operating System - HP-UX
1845517
Members
3899
Online
110244
Solutions
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
Forums
Categories
This widget could not be displayed.
Company
This widget could not be displayed.
Local Language
This widget could not be displayed.
back
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
back
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
Blogs
Information
This widget could not be displayed.
This widget could not be displayed.
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- This widget could not be displayed.This widget could not be displayed.This widget could not be displayed.This widget could not be displayed.This widget could not be displayed.This widget could not be displayed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2006 09:16 AM
11-03-2006 09:16 AM
Perl to send cntl c and cntl d
I am using the telnet module in perl to telnet to a switch
The funky thing about this switch is that I need to send a cntrl D to get a prompt, then I type a command, and to send the command I need to type a control C.
How do I incorporate this in my script.
Or convert it to actual control characters.
I thought there was a way to do this in vi...
The funky thing about this switch is that I need to send a cntrl D to get a prompt, then I type a command, and to send the command I need to type a control C.
How do I incorporate this in my script.
Or convert it to actual control characters.
I thought there was a way to do this in vi...
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2006 11:22 AM
11-03-2006 11:22 AM
Re: Perl to send cntl c and cntl d
Hi:
You can generate a Ctrl_C with "\003" and Ctrl_D with "\004".
# echo "\003" | cat -etv
# perl -e 'print "\003"' | cat -etv
If you want to create these characters in a 'vi' session, type Ctrl_v and then press either Ctrl_C or Ctrl_D. See the 'ascii(5)' manpages for more information.
Regards!
...JRF...
Regards!
...JRF...
You can generate a Ctrl_C with "\003" and Ctrl_D with "\004".
# echo "\003" | cat -etv
# perl -e 'print "\003"' | cat -etv
If you want to create these characters in a 'vi' session, type Ctrl_v and then press either Ctrl_C or Ctrl_D. See the 'ascii(5)' manpages for more information.
Regards!
...JRF...
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2006 06:56 PM
11-03-2006 06:56 PM
Re: Perl to send cntl c and cntl d
perl does have a much nicer way to write that:
# perl -le 'print "\cC\cD"'
# perl -le 'print "\cC\cD"' | perl -nle'print join " ", unpack"C*",$_'
3 4
#
Enjoy, Have FUN! H.Merijn
# perl -le 'print "\cC\cD"'
# perl -le 'print "\cC\cD"' | perl -nle'print join " ", unpack"C*",$_'
3 4
#
Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2006 01:36 PM
11-23-2006 01:36 PM
Re: Perl to send cntl c and cntl d
I have taken the low road and went with a quick expect script called by perl
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP