jEdit Community - Resources for users of the jEdit Text Editor
Inserting ^D into a program with Jedit
Submitted by r0b on Wednesday, 27 August, 2008 - 15:22
I've been racking my brain since 06:00 this morning trying to figure out how to insert a -d into a program. I'm automating a process using expect and need to pass -d to the interface it is communicating with. I've pushed my google-foo as far as I can, and I've searched the Help Section as best I can and turned up nothing of use. I've tried whitespace, but it's only for viewing 'invisible characters'. My apologies for the frustration and my lack of knowledge. My deepest gratitude to those willing to 'show me the way'.
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
edit
by r0b on Wed, 27/08/2008 - 15:23
-d should have been control-d
 
???
by Robert Schwenn on Wed, 27/08/2008 - 20:26
Sorry, I can't understand Your goal.

- How do You "insert CTRL+D into the program" without automation?
- What's "expect"?
- Witch role does jEdit play in this game?

Robert
 
Expect is a tool for automati
by r0b on Wed, 27/08/2008 - 21:03
Expect is a tool for automating interactive applications such as telnet, ssh, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this stuff trivial. Expect is also useful for testing these same applications. And by adding Tk, you can also wrap interactive applications in X11 GUIs.

I typically use jEdit for all of my editing needs, but have found that it does not deal well with situations where the script has to have a specific CTRL code, such as CTRL+D in it. So typically I have to program around that section and finish that part using vi or some other editor. I really don't like having to do this.

send -- "^D" # code snippet

My goal is to be able to insert the CTRL+D as shown above into my program as required using jEdit as my editor.
 
???
by Robert Schwenn on Thu, 28/08/2008 - 21:11
If I understand You correct, You are writing source code as a script and want to insert the string "^D" into this script file? So, as You (and I too) have written this string here to the forum, I can write in in a text file - and of course with jEdit, too.

What's the problem? What do I not understand?

Robert
 
A string saves ^D (how it is
by r0b on Thu, 28/08/2008 - 22:08
A string saves ^D (how it is represented/displayed in vi) as two separate characters. I need to save it as a single character such as in vi. In vi's insert mode you must press CTRL+V (which tells it the editor to be ready to receive a control character) and then CTRL+D which inserts the eof character as a single character into the source code. When I refer to CTRL+D or CTRL+C (interrupt) I am referring to the single character that is sent by the keyboard by pressing these keys in combination (eg in windows CTRL+ALT+DEL best non unix example I can think of).
 
It sounds to me like you are
by elberry on Thu, 28/08/2008 - 22:52
It sounds to me like you are simply asking for a way to insert special characters, one of which is the 'eof' character.

If so, you might try the CharacterMap plugin.

I would like to point out, however, that when you type CTRL+ALT+DEL, windows doesn't actually interpret that as being a SINGLE character. You do actually need to check to see if all three of those keys are simultaneously pressed, and then perform an operation.

This is the same in VI, that is why you see ^D (notice the two characters '^' and 'D') typed and not 'D' (as a single character).

Vi isn't interpreting CTRL+D as a single character, it sees that CTRL and D are both pressed and then it inserts the 'eof' character.

Learn from the past. Live in the present. Plan for the future.
11101000
Blog
 
My apologies for the mistake
by r0b on Fri, 29/08/2008 - 03:50
My apologies for the mistake about how CTRL+ALT+DEL are interpreted and the other misconceptions I had. I was trying to explain things the best way I knew how and understood them to be. You have led me to the path I was seeking. You all have my deepest gratitude for the assistance.
User login
Browse archives
« November 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   101634
Context Free Art (*.cfdg)   0.31   46062
BBEdit scheme   1.0   18601
JBuilder scheme   .001   18502
ColdFusion scheme   1.0   18031
R Edit Mode - extensive version   0.1   17481
Advanced HTML edit mode   1.0   16213
Matlab Edit Mode   1.0   16075
jEdit XP icons   1.0   15236
XP icons for jEdit   1.1   14300