10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In bash, you can do something like this:
#!/bin/bash
echo -n "What is your name? " > /dev/tty
read thename < /dev/tty
How can I do the same in python?
I have a python script that has the following content:
#!/usr/bin/python2.7
import getpass
import sys
import telnetlib
import... (2 Replies)
Discussion started by: SkySmart
2 Replies
2. Shell Programming and Scripting
Suppose another person wrote the following one-line shell script:
echo $RANDOM > /dev/tty
QUESTION #1: How can the random number, which is output to the terminal by this script, be captured in a variable?
QUESTION #2: How can this be done in a cron job?
Specific code, whether in ksh or... (1 Reply)
Discussion started by: Paul R
1 Replies
3. UNIX for Dummies Questions & Answers
hi,
From the below script:
##########################################pwd_auth.sh########################################################################################
#Author: Pandeeswaran Bhoopathy
#Written on:26th Jan 2012 2:00PM
#This script describes the feature of stty and illustrates... (3 Replies)
Discussion started by: pandeesh
3 Replies
4. UNIX for Dummies Questions & Answers
what can I use to find the last modified time of a /dev/tty ? (4 Replies)
Discussion started by: l flipboi l
4 Replies
5. Programming
Hello everybody:
I have a child process which reads a password from /dev/tty, as far as I know file descriptors for the child process can be seen by using lsof, so I want to connect to such device in order to send the password through a pipe, how could I do that? (2 Replies)
Discussion started by: edgarvm
2 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I need to provide more than one character to "> /dev/tty" through terminal/keyboard input, I have this:
ok=false
while
do
echo " Enter r1 to reformat "
> /dev/tty
read choice
case $choice in
)
echo " bla bla bla "
;;
done
However, in this way,... (3 Replies)
Discussion started by: Gery
3 Replies
7. Programming
Since the existence of /dev/tty is not guaranteed, what happens when an attempt is made to open /dev/tty and there's no controlling terminal?
Will it fail, or open /dev/null instead? Or do something else?
So is checking for NULL in the code below a safe way of checking whether opening... (2 Replies)
Discussion started by: gencon
2 Replies
8. Solaris
Hi, Anyone can help
My solaris 8 system has the following
/dev/null , /dev/tty and /dev/console
All permission are lrwxrwxrwx
Can this be change to a non-world write ??
any impact ?? (12 Replies)
Discussion started by: civic2005
12 Replies
9. Cybersecurity
I suspect that someone is using a sniffer on my Ethernet connection,
OS X 10.3.9, DSL,
ok, I'm in terminal using the "ifconfig" command >
flags=8049<UP,LOOPBACK,RUNNING,MULTICAST>mtu 16384
right, it's not in "promiscuous mode", but i think it's Trojaned, can anyone point me in the... (1 Reply)
Discussion started by: su"do"er
1 Replies
10. UNIX for Dummies Questions & Answers
Hi,
When it proccesing the backup with cpio report this message: Cannot open "/dev/tty" and cancel de backup.
Cuando se procesa la tarea del backup reporta el error: Cannot open "/dev/tty" y cancela el backup y no termina correctamente, a que se devera esta advertencia.
Gracias.
Thacks.... (3 Replies)
Discussion started by: cmr88
3 Replies
TTY(4) Linux Programmer's Manual TTY(4)
NAME
tty - controlling terminal
DESCRIPTION
The file /dev/tty is a character file with major number 5 and minor number 0, usually of mode 0666 and owner.group root.tty. It is a syn-
onym for the controlling terminal of a process, if any.
In addition to the ioctl(2) requests supported by the device that tty refers to, the ioctl(2) request TIOCNOTTY is supported.
TIOCNOTTY
Detach the calling process from its controlling terminal.
If the process is the session leader, then SIGHUP and SIGCONT signals are sent to the foreground process group and all processes in the
current session lose their controlling tty.
This ioctl(2) call only works on file descriptors connected to /dev/tty. It is used by daemon processes when they are invoked by a user at
a terminal. The process attempts to open /dev/tty. If the open succeeds, it detaches itself from the terminal by using TIOCNOTTY, while
if the open fails, it is obviously not attached to a terminal and does not need to detach itself.
FILES
/dev/tty
SEE ALSO
chown(1), mknod(1), ioctl(2), termios(3), console(4), tty_ioctl(4), ttyS(4), agetty(8), mingetty(8)
COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2003-04-07 TTY(4)