Sponsored Content
Top Forums Shell Programming and Scripting Vi : Is it possible to send ctrl + d signal from a file made with vi and executing it. Post 302789473 by hanson44 on Wednesday 3rd of April 2013 05:36:04 PM
Old 04-03-2013
It does not make sense to put CTL-D inside a script file for purposes of exiting the script. As previously suggested, use "exit".

If you want to enter CTL-D into the file, using vi, just use CTL-V CTL-D sequence.

When a program is receiving input from stdin, you can enter CTL-D at the beginning of a line to signal "end of file". I think that's what you're getting mixed up. "end of file" for a Unix file is just signaled by end of file (no more content), period. Putting CTL-D in the middle of the file does not signal "end of file". You can verify with a test. Put CTL-D somewhere toward the top of the file, and cat the file. The whole file is shown, not just the part before the CTL-D.
This User Gave Thanks to hanson44 For This Post:
 

10 More Discussions You Might Find Interesting

1. AIX

Disable ctrl-c,ctrl-d,ctrl-d in ksh script

I wrote a ksh script for Helpdesk. I need to know how to disable ctrl-c,ctrl-z,ctrl-d..... so that helpdesk would not be able to get to system prompt :confused: (6 Replies)
Discussion started by: wtofu
6 Replies

2. Shell Programming and Scripting

Ctrl-C signal propagation

Hello I have a master startup script (let's call it myScript) that displays a menu from which the user can start/stop several instances of a server. When I issue the start command for one of the servers from the menu and then exit myScript through the provided mechanism (enter "q" in this case),... (2 Replies)
Discussion started by: EvilBoz
2 Replies

3. Shell Programming and Scripting

How to send SIGNAL to the thread?

Hello, I have to send SIGSEGV to the thread. What is the simplest and efficient way to do that? (6 Replies)
Discussion started by: Rahulpict
6 Replies

4. Shell Programming and Scripting

How to send Ctrl Break combination in Expect

Greetings, I am writing an Expect script to automate multiple processes on an HP-UX system. Everything has gone fine so far but I now have run into a problem. One of the processes that I'm trying to automate requires the key combination of ctrl break and I have so far been unable to figure out... (1 Reply)
Discussion started by: g_trueblood2000
1 Replies

5. Programming

how can i make that a process child send a signal?

I'm trying to do a program that makes activate an signal (SINGALARM) when the next child of a son appears but this not works. I have to caught the next child o the other (pid), to send a singnal which inform a menssage. It's anything worng in the code? thanks. the code: #include... (2 Replies)
Discussion started by: marmaster
2 Replies

6. Shell Programming and Scripting

Script to send alert if any changes are made in crontab.

Hi i want to know how can i write a script to check if any changes are made and send an alert in crontabs . i am using .ksh file extension for writing scripts. (3 Replies)
Discussion started by: honey26
3 Replies

7. Shell Programming and Scripting

ctrl c trapping signal

im trying to make a trap signal 2 (ctrl c) in a bash script if a user presses ctrl c while running the script it should display an error message but not quit the bash script just yet. User will have to press "enter" to quit This is what i have so far #trap trap_control 2 #while true #do... (6 Replies)
Discussion started by: gangsta
6 Replies

8. AIX

Send ctrl+C in expect script

Hi, Am trying to transfer file via FTP using expect script from server to client i need to interrupt the file transfer between server and client Please help what should used in expect code.. I used send "ctrl+c\r" expect "Aborted" but that didnt work.. I need what should... (3 Replies)
Discussion started by: Priya Amaresh
3 Replies

9. Shell Programming and Scripting

Send ctrl-C signal using bash script.

declare -a array=( "LLC-load-misses" "LLC-loads" "LLC-store-misses" "LLC-stores" "branch-load-misses" "branch-loads" "dTLB-load-misses" "dTLB-loads" "dTLB-store-misses" "dTLB-stores" "iTLB-load-misses" "iTLB-loads" "branch-instructions" "branch-misses" "bus-cycles" "cache-misses" "cache-references"... (2 Replies)
Discussion started by: BHASKAR JUPUDI
2 Replies

10. Shell Programming and Scripting

Expect command to send the user input enter or ctrl+c

Hey All, I am writing one script using expect, that script which is used in spawn will accepts only 1. Enter 2. Ctrl+c Press Control-C to exit, Enter to proceed. Could some one share some thoughts to send the above user inputs in linux expect block ? Thanks, Sam (0 Replies)
Discussion started by: SCHITIMA
0 Replies
HEXCURSE(1)						      General Commands Manual						       HEXCURSE(1)

NAME
hexcurse - an ncurses-based hex editor SYNOPSIS
hexcurse [ -? | -help ] [ -a ] [ -r rnum ] [ -o outputfile ] [ [ -i ] inputfile ] DESCRIPTION
hexcurse is an ncurses-based hexeditor utility that is able to open, modify, and save a file to disk while providing useful editing and searching options. OPTIONS
-? | -help Prints out the command usage info -a Specifies the addresses to be output in decimal format initially. -r rnum Specifies the number of characters per line that the hexeditor should output. If rnum is either less than 1 or greater than the columns of the current terminal, hexcurse will fill the terminal width, just as if the -r was not specified. -o outputfile Specifies the output file to be written to by default. [-i] inputfile Specifies the input file to be read in. -i is not needed if inputfile is the last argument on the line. INTERACTIVE OPTIONS
F1 | ctrl+? Shows key command help. F2 | ctrl+s Save the current file. F3 | ctrl+o Opens a file. F4 | ctrl+g Goto a certain location in the current file. Depending on which way the addresses are being viewed at the moment, the search will behave differently. If the addresses are currently in hex format, the search will search as if the input was given in hexadecimal format. If the addresses are in decimal format, the function will search for the address in decimal. F5 | ctrl+f Search for a certain string in the current file. Depending on which window the user is currently editing in, this search will behave differently. If editing in the hex window, the input should only be in hexadecimal, and it will search for the hexadecimal "string." If the current editing window is the ASCII window, the input should be ASCII characters, and the search will find that ASCII string in the file. F6 | ctrl+a Switch between hexadecimal address values and decimal address values. F7 | TAB Switch between the hexadecimal and ASCII editing windows. F8 | ctrl+q | ctrl+x Exit out of the program. Page Up | ctrl+u Scroll one 'page' up. Page Down | ctrl+d Scroll one 'page' down. Home | ctrl+t Returns to the top of the file. End | ctrl+b Jumps to the bottom of the file. ctrl+z Undo the last modification. Can be used multiple times. Esc Escapes out of the save, open, goto, and find prompts. SEE ALSO
hexdump(1) , ncurses(3) AUTHORS
The authors of hexcurse are: jewfish <jewfish@jewfish.net> armoth <uknowho@jewfish.net> The current version of this software is always availabe at http://www.jewfish.net/software.php BUGS
On some terminals the function keys will not work. Support for resizable terminals is still a bit rudimentary. At this time, when the terminal is resized, the cursor is positioned at the beginning of the file. This will be corrected in the next release. There is also an issue where the labels on the bottom of the screen do not resize correctly. A fix for the latter is in the works. To report a bug or problem, please e-mail: devel@jewfish.net TODO
When we get the time, we would like to implement the ability to insert and delete data from the file. Please e-mail us with any additional suggestions. 22 December 2003 HEXCURSE(1)
All times are GMT -4. The time now is 02:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy