03-01-2010
Thanks Jim.
The code I posted is the code to handle 'what happens if stdin is redirected'. My call to isatty() is just above the snippet I posted.
Cheers.
10 More Discussions You Might Find Interesting
1. 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
2. UNIX for Advanced & Expert Users
Hi...
This is message that occurs when i am trying to shutdown the linux system
timeout opening writing control channel /dev/initctl
how can i shutdown what is the problem here..
Thanks in advance
... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies
3. 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
4. Programming
hello all,
Being root, I would like to log user activity (also multiple root activity), i don't really like
history file based logging, lets assume that users have access to their .profile.
I would like to write a monitoring daemon in C that would capture /dev/ttys,
so I need to do a... (0 Replies)
Discussion started by: wayward
0 Replies
5. 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
6. 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
7. 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
8. 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
9. AIX
Hello,
One one of my AIX boxes I'm having the following errror:
fcstat fcs0:
Port Speed (supported): 4 GBIT
Error opening device: /dev/fscsi0
errno: 0000003d
Has anyone encountered similar errors?
Thank you! (1 Reply)
Discussion started by: aixn00b
1 Replies
10. 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
LEARN ABOUT OPENSOLARIS
item_init
menu_hook(3CURSES) Curses Library Functions menu_hook(3CURSES)
NAME
menu_hook, set_item_init, item_init, set_item_term, item_term, set_menu_init, menu_init, set_menu_term, menu_term - assign application-spe-
cific routines for automatic invocation by menus
SYNOPSIS
cc [ flag... ] file... -lmenu -lcurses [ library... ]
#include <menu.h>
int set_item_init(MENU *menu, void (*func)(MENU *));
int set_item_term(MENU *menu, void (*func)(MENU *));
void item_term(MENU *menu);
int set_menu_init(MENU *menu, void (*func)(MENU *));
void menu_init(MENU *menu);
int set_menu_term(MENU *menu, void (*func)(MENU *));
void menu_term(MENU *menu);
DESCRIPTION
set_item_init() assigns the application-defined function to be called when the menu is posted and just after the current item changes.
item_init() returns a pointer to the item initialization routine, if any, called when the menu is posted and just after the current item
changes.
set_item_term() assigns an application-defined function to be called when the menu is unposted and just before the current item changes.
item_term() returns a pointer to the termination function, if any, called when the menu is unposted and just before the current item
changes.
set_menu_init() assigns an application-defined function to be called when the menu is posted and just after the top row changes on a posted
menu. menu_init() returns a pointer to the menu initialization routine, if any, called when the menu is posted and just after the top row
changes on a posted menu.
set_menu_term() assigns an application-defined function to be called when the menu is unposted and just before the top row changes on a
posted menu. menu_term() returns a pointer to the menu termination routine, if any, called when the menu is unposted and just before the
top row changes on a posted menu.
RETURN VALUES
Routines that return pointers always return NULL on error. Routines that return an integer return one of the following:
E_OK The routine returned successfully.
E_SYSTEM_ERROR System error.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO
curses(3CURSES), menus(3CURSES), attributes(5)
NOTES
The header <menu.h> automatically includes the headers <eti.h> and <curses.h>.
SunOS 5.11 31 Dec 1996 menu_hook(3CURSES)