10-24-2006
Quote:
Originally Posted by sanchopansa
@Glenn Arndt
I am using bash and I looked through the trap sigspecs and couldn't find which signal corresponds to CTRL+D.
Ctrl-D isn't a signal. It closes stdin.
10 More Discussions You Might Find Interesting
1. AIX
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. UNIX for Dummies Questions & Answers
Hi
I was working on a shell script with randomly shows a page of text from a randomly selected topic .As soon as the page is displayed it callers a timer script which keeps on running indefinitely until the timer script is killed by the user.
This is where I have the problem,if I press... (2 Replies)
Discussion started by: mervin2006
2 Replies
3. Shell Programming and Scripting
I now that this isnt the greatest code around. Im a network guy by trade not a programer .. but needed something to compare config files ...
Anyway ... intermittently, the program terminates.
Ive been looking at the code for a week trying to figure it out and Im stumped. Can anyone provide... (0 Replies)
Discussion started by: popeye
0 Replies
4. Shell Programming and Scripting
Hi all, I connect with SSH connection to remote machine in the script and ı want to logout at half of the script then continue to script. If ı write exit in the script it terminates script not SSH connection. How can i do that please help me (1 Reply)
Discussion started by: fozay
1 Replies
5. Shell Programming and Scripting
Hi all , i know i ask a lot of question but these are really hard to solve and important question. I send two scripts:
expect.sh:
#!/usr/local/bin/expect
spawn ssh root@172.30.64.163
expect "login:"
send "root\n"
expect "password:"
send "root\n^M"
interact
and
son.sh:
... (2 Replies)
Discussion started by: fozay
2 Replies
6. Shell Programming and Scripting
H! I have written script where it need to invoke the perl script in background, then write the pid in temp file then bring back the job to foreground. whenever the Ctrl-C or Ctrl-Z is pressed in the script has to exit and prompt should be dispalyed. but this script causing exit from shell session... (2 Replies)
Discussion started by: jramesh1
2 Replies
7. UNIX for Advanced & Expert Users
Hi everyone,
I am new to the linux.I wrote a small script and assigning two values to fname and lname and I want if the fname or lname are not given proper name like Toys or Gun the script should terminate and if they are given proper name it should execute.please help thanks:wall:
#!/bin/bash... (4 Replies)
Discussion started by: starter2011
4 Replies
8. Shell Programming and Scripting
Hi,
while executing shell script, in the middle of the process, if we kill the shell script( ctrl+z or ctrl+c), script will be killed and the files which using for the script will be in the folder.
How to handle those scenarios. Is there any possibilities, if user breaks the script, I need to... (3 Replies)
Discussion started by: ckchelladurai
3 Replies
9. UNIX for Dummies Questions & Answers
Hi friends,
I am trying to add a newline char ('\n') between the query and the commit statement in the following shell script.
#! /bin/sh
echo "select * from tab; commit;" > data.sql
I have tried typing in "Ctrl-V + Ctrl-J" combination which has inserted ^@ (NUL) character but the commit... (1 Reply)
Discussion started by: royalibrahim
1 Replies
10. Shell Programming and Scripting
Hi..!
I'm stuck with my automation of starting a process and keeping it running even after the current ssh session has exited..
So i'm trying to use command 'screen'. which is doing exactly what i wanted, But the problem is automation of the same.
i will have to press Ctrl+a and Ctrl+d for... (2 Replies)
Discussion started by: chandana hs
2 Replies
pty(4) Kernel Interfaces Manual pty(4)
Name
pty - pseudoterminal driver
Syntax
pseudo-device pty[n]
Description
The driver provides support for a device-pair termed a pseudoterminal. A pseudoterminal is a pair of character devices, a master device
and a slave device. The slave device provides processes with an interface identical to that described in However, whereas all other
devices that provide the interface described in have a hardware device of some sort behind them, the slave device has, instead, another
process manipulating it through the master half of the pseudoterminal. That is, anything written on the master device is given to the
slave device as input and anything written on the slave device is presented as input on the master device. The slave device can be opened
multiple times, while the master half can be opened only once.
If no optional n value is given defining the number of pseudoterminal pairs to be configured, 16 pseudoterminal pairs are configured. All
pseudoterminal lines should have a corresponding entry in the /etc/ttys file. This must be done to insure that logins that use pseudoter-
minals will be tracked in the utmp and wtmp files.
The following calls apply only to pseudoterminals:
TIOCSTOP
Stops output to a terminal (for example, like typing CTRL/S). Takes no parameter.
TIOCSTART
Restarts output (stopped by TIOCSTOP or by typing CTRL/S). Takes no parameter.
TIOCPKT
Enable/disable packet mode. Packet mode is enabled by specifying (by reference) a nonzero parameter and disabled by specifying (by
reference) a zero parameter. When applied to the master side of a pseudoterminal, each subsequent from the terminal will return
data written on the slave part of the pseudoterminal preceded by a zero byte (symbolically defined as TIOCPKT_DATA), or a single
byte reflecting control status information. In the latter case, the byte is an inclusive-or of zero or more of the bits:
TIOCPKT_FLUSHREAD
whenever the read queue for the terminal is flushed.
TIOCPKT_FLUSHWRITE
whenever the write queue for the terminal is flushed.
TIOCPKT_STOP
whenever output to the terminal is stopped by typing CTRL/S.
TIOCPKT_START
whenever output to the terminal is restarted.
TIOCPKT_DOSTOP
whenever the stop character is CTRL/S and the start character is CTRL/Q.
TIOCPKT_NOSTOP
whenever the start and stop characters are not CTRL/S and/or CTRL/Q.
This mode is used by and to implement a remote-echoed, locally flow-controlled (using CTRL/S or CTRL/Q, or both) remote login with
proper back-flushing of output. It can be used by other similar programs.
TIOCREMOTE
A mode for the master half of a pseudoterminal, independent of TIOCPKT. This mode causes input to the pseudoterminal to be flow
controlled and not input edited (regardless of the terminal mode). Each write to the control terminal produces a record boundary
for the process reading the terminal. In normal usage, a write of data is like the data typed as a line on the terminal; a write of
0 bytes is like typing an end-of-file character. TIOCREMOTE can be used when doing remote line editing in a window manager, or
whenever flow-controlled input is required.
TIOCMASTER
Allows the master to have complete control over the pseudoterminal and causes the slave side to sleep until the master relinquishes
control. This is useful in preventing changes on the pseudoterminal from going undetected and being reset by the master.
Files
(master pseudoterminals)
(slave pseudoterminals)
See Also
tty(4), MAKEDEV(8)
pty(4)