02-09-2009
You can save your tty's values with stty -g, then restore them by giving stty that same output on the commandline. How to do this in C is a trickier question if you don't feel like using system(), since there's a lot of ioctl calls involved. You could run strace on stty to see what calls its making to get the values and set the values, though sometimes it might print ambiguous statements due to ioctls meaning different things on different kinds of files.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have a file like this.
1,1,1,0,0,0
1,1,2,1,0,0
1,1,3,0,0,0
1,1,4,0,0,0
...........
...........
1,1,24,0,0,0
1,1,25,0,0,0
1,1,26,1,0,0
1,1,27,0,0,0
1,2,1,0,0,0
1,2,2,0,0,0
1,2,3,0,0,0
1,2,4,0,0,0
1,2,5,1,0,0
1,2,6,1,0,0 (4 Replies)
Discussion started by: vskr72
4 Replies
2. Programming
I have SQL giving me output of disabled ids in the system every day.
I can send on email for this disabled user list.
But I want to send one email for every disabled user or for every row.
thank you for your help.
Kyle (2 Replies)
Discussion started by: s1a2m3
2 Replies
3. Shell Programming and Scripting
Hi All,
how do I set in .profile file Unix terminal background color = BLUE ?
Please advice me.
:confused: (2 Replies)
Discussion started by: raghur77
2 Replies
4. Linux
Hello,
I connect to linux using serial cable from windows machine.
I use putty as serial terminal emulator.
Everything works fine except programs which scroll text - man, more, less, vi, etc.. These programs asumme my terminal size is 80cols x 24rows (my putty window size is more than that,... (1 Reply)
Discussion started by: vilius
1 Replies
5. Shell Programming and Scripting
i ask to do ,,program that convert the last row to be the first row ,,,and after that exchange the the columns
ex,,
1 2 3
4 5 6
7 8 9
to be
7 8 9
4 5 6
1 2 3
and then to be
9 8 7
6 5 4
3 2 1
give mee the code .... (0 Replies)
Discussion started by: khaled1989kh
0 Replies
6. UNIX for Dummies Questions & Answers
i ask to do ,,program that convert the last row to be the first row ,,,and after that exchange the the columns
ex,,
1 2 3
4 5 6
7 8 9
to be
7 8 9
4 5 6
1 2 3
and then to be
9 8 7
6 5 4
3 2 1 (0 Replies)
Discussion started by: khaled1989kh
0 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have a tab-delimited file as follows:
1 1 2 2 3 3 4 4
a a b b c c d d
5 5 6 6 7 7 8 8
e e f f g g h h
9 9 10 10 11 11 12 12
i i j j k k l l
13 13 14 14 15 15 16 16
m m n n o o p p
The output I need is:
1 1 a a 5 5 e e 9 9 i i 13... (5 Replies)
Discussion started by: mvaishnav
5 Replies
8. Linux
I installed version 4.6.4 of gnuplot recently on my system running 10.04 ubuntu linux. I am getting error
Terminal type set to 'unknown'
Also when i try to set term X11 or wxt i get error
Terminal type set to 'unknown'
^
unknown or ambiguous terminal... (5 Replies)
Discussion started by: Ujjwal1982
5 Replies
9. UNIX for Dummies Questions & Answers
I am wondering about the following:
stty columns 140
I have found that a number of times I need to set my display columns to a high number (such as 140) but I have to do this every time I login to use putty/ssh. Can we set this with an environmental variable so that it is permanent?
Also... (4 Replies)
Discussion started by: newbie2010
4 Replies
10. Shell Programming and Scripting
Hi,
I am trying to put stty columns 140 in .profile to set column width to 140 so I don't have to manully do it every time.
My main goal is to avoid seeing "Terminal too wide" message whenever I try to use vi editor in full screen.
I am on korn shell
echo $SHELL
/bin/ksh
So even... (8 Replies)
Discussion started by: pat_pramod
8 Replies
CU(1C) CU(1C)
NAME
cu - call UNIX
SYNOPSIS
cu telno [ -t ] [ -s speed ] [ -a acu ] [ -l line ]
DESCRIPTION
Cu calls up another UNIX system, a terminal, or possibly a non-UNIX system. It manages an interactive conversation with possible transfers
of text files. Telno is the telephone number, with minus signs at appropriate places for delays. The -t flag is used to dial out to a
terminal. Speed gives the transmission speed (110, 134, 150, 300, 1200); 300 is the default value.
The -a and -l values may be used to specify pathnames for the ACU and communications line devices. They can be used to override the fol-
lowing built-in choices:
-a /dev/cua0 -l /dev/cul0
After making the connection, cu runs as two processes: the send process reads the standard input and passes most of it to the remote sys-
tem; the receive process reads from the remote system and passes most data to the standard output. Lines beginning with `~' have special
meanings.
The send process interprets the following:
~. terminate the conversation.
~EOT terminate the conversation
~<file send the contents of file to the remote system, as though typed at the terminal.
~! invoke an interactive shell on the local system.
~!cmd ... run the command on the local system (via sh -c).
~$cmd ... run the command locally and send its output to the remote system.
~%take from [to] copy file `from' (on the remote system) to file `to' on the local system. If `to' is omitted, the `from' name is used
both places.
~%put from [to] copy file `from' (on local system) to file `to' on remote system. If `to' is omitted, the `from' name is used both
places.
~~... send the line `~...'.
The receive process handles output diversions of the following form:
~>[>][:]file
zero or more lines to be written to file
~>
In any case, output is diverted (or appended, if `>>' used) to the file. If `:' is used, the diversion is silent, i.e., it is written only
to the file. If `:' is omitted, output is written both to the file and to the standard output. The trailing `~>' terminates the diver-
sion.
The use of ~%put requires stty and cat on the remote side. It also requires that the current erase and kill characters on the remote sys-
tem be identical to the current ones on the local system. Backslashes are inserted at appropriate places.
The use of ~%take requires the existence of echo and tee on the remote system. Also, stty tabs mode is required on the remote system if
tabs are to be copied without expansion.
FILES
/dev/cua0
/dev/cul0
/dev/null
SEE ALSO
dn(4), tty(4)
DIAGNOSTICS
Exit code is zero for normal exit, nonzero (various values) otherwise.
BUGS
The syntax is unique.
CU(1C)