In addition to what has already been said, CODE tags use a fixed width font. So text like:
iiiiiiiiii
WWWWWWWWWW
which looks like very different line lengths without CODE tags, clearly show that they contain the same number of characters when that same text is displayed using CODE tags:
And, if your code or data contains tab characters, those tabs are preserved if you copy and paste text from regions of a post that are tagged by CODE or ICODE tags, but copy as spaces when not tagged.
So, yes: always use code tags for full line sample code, input, and output; and use icode tags for partial line, imbedded sample code, input, and output!
I'm a Unix newbie.
In a shell-script, is there any way to accept keyboard input (via STDIN) without having it display on the screen? I know keying in a login password sort of does this by replacing what you key with astericks (*) but I believe that's a "C" routine. I'd like to be able to... (2 Replies)
How can I write to another user's pseudo tty, but not to its current prompt position (as in open("/dev/pts007", ...) followed by write() ). Instead I would like to write to the top center of the screen using color red, for example. Like curses, but from another console. (6 Replies)
I am developing a script that will run with '/bin/ksh' shell.
The script is intended to receive a password by keyboard input, but for security reasons I would like to hide what the user is typing.
The keyboard input is being caught by 'read' command.
exmaple :
echo "Please type your new... (1 Reply)
Hi all,
i type a command along with dtterm what i would like to have is that the output of the command to be shown in the new terminal .
Any Idea on how to acheive this? (0 Replies)
Hey,
How can I transfer the terminal output to a file ?
For example :
command "fuser" returns the "process-id" and prints the output on the terminal, but I want that output to a file as well. How can I do that ?
/clocal/mqbrkrs/user/mqsiadm/sanjay/AccessMonitor $ fuser -uf... (2 Replies)
My knowledge of Unix input/output/devices is very hazy so could someone please tell me if the following is secure?
I log on to an account on a shared Unix server (Linux 2.6.18-6-686) using ssh (PuTTY). I start a python program and then type into it (python raw_input command) the... (2 Replies)
Hello everybody!!!
I am writing my own rm command in unix.
I prompt the user to type if he wants to delete a file and then read what he typed.
But how do i check what he typed?
This is my program so far:
echo 'Delete prog1.c (y/n)?'
read yesOrNo
if yesOrNo == 'y'
then
rm prog1.c... (6 Replies)
Hello, everyone.
Could someone, please, tell me how to get the number of bytes in the terminal input queue without blocking and without consuming these bytes? I guess it could be called the peek functionality.
I've looked at termio tcgetattr() and tcsetattr() functions but could not find... (4 Replies)
This is my input file like this
03,105581,,015,+00000416418,,,901,+00000000148,,,922,+00000000354,,/
49,+00000000000416920,00002/
03,5313236,,015,+00231036992,,,045,+00231036992,,,901,+00000048428,,/
88,100,+0000000000000,0000000,,400,+0000000000000,0000000,/
88,902,+0000000079077,,/... (0 Replies)
Hello All,
I have a text file containing output from a command that contains lots of escape/control characters that when viewed using vi or view, looks like jibberish. But when viewed using the cat command the output is formatted properly.
Is there any way to take the output from the cat... (7 Replies)
Discussion started by: mrm5102
7 Replies
LEARN ABOUT BSD
pty
PTY(4) Kernel Interfaces Manual PTY(4)NAME
pty - pseudo terminal driver
SYNOPSIS
/sys/conf/SYSTEM:
NPTY ptys # pseudo-terminals, in groups of 8
DESCRIPTION
The pty driver provides support for a device-pair termed a pseudo terminal. A pseudo terminal is a pair of character devices, a master
device and a slave device. The slave device provides processes an interface identical to that described in tty(4). However, whereas all
other devices which provide the interface described in tty(4) have a hardware device of some sort behind them, the slave device has,
instead, another process manipulating it through the master half of the pseudo terminal. 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.
In configuring, ptys specifies the number of pseudo terminal pairs are configured.
The following ioctl calls apply only to pseudo terminals:
TIOCSTOP
Stops output to a terminal (e.g. like typing ^S). Takes no parameter.
TIOCSTART
Restarts output (stopped by TIOCSTOP or by typing ^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 pseudo terminal, each subsequent read from the terminal will
return data written on the slave part of the pseudo terminal 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 a la ^S.
TIOCPKT_START
whenever output to the terminal is restarted.
TIOCPKT_DOSTOP
whenever t_stopc is ^S and t_startc is ^Q.
TIOCPKT_NOSTOP
whenever the start and stop characters are not ^S/^Q.
While this mode is in use, the presence of control status information to be read from the master side may be detected by a select
for exceptional conditions.
This mode is used by rlogin(1C) and rlogind(8C) to implement a remote-echoed, locally ^S/^Q flow-controlled remote login with proper
back-flushing of output; it can be used by other similar programs.
TIOCUCNTL
Enable/disable a mode that allows a small number of simple user ioctl commands to be passed through the pseudo-terminal, using a
protocol similar to that of TIOCPKT. The TIOCUCNTL and TIOCPKT modes are mutually exclusive. This mode is enabled from the master
side of a pseudo terminal by specifying (by reference) a nonzero parameter and disabled by specifying (by reference) a zero parame-
ter. Each subsequent read from the master side will return data written on the slave part of the pseudo terminal preceded by a zero
byte, or a single byte reflecting a user control operation on the slave side. A user control command consists of a special ioctl
operation with no data; the command is given as UIOCCMD(n), where n is a number in the range 1-255. The operation value n will be
received as a single byte on the next read from the master side. The ioctl UIOCCMD(0) is a no-op that may be used to probe for the
existence of this facility. As with TIOCPKT mode, command operations may be detected with a select for exceptional conditions.
TIOCREMOTE
A mode for the master half of a pseudo terminal, independent of TIOCPKT. This mode causes input to the pseudo terminal 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.
FILES
/dev/pty[p-r][0-9a-f] master pseudo terminals
/dev/tty[p-r][0-9a-f] slave pseudo terminals
DIAGNOSTICS
None.
4.2 Berkeley Distribution May 19, 1986 PTY(4)