Sponsored Content
Top Forums Shell Programming and Scripting POSIX way of getting columns in tty? Post 302275406 by fpmurphy on Saturday 10th of January 2009 08:34:10 AM
Old 01-10-2009
It is not part of POSIX.1, but most shells initialize a COLUMNS variable.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

kill the tty

Hello Experts i'm having some trouble with a script. the purpose is to kill all processes from a distinct tty in a HP-UX machine, given the User TTY. it's to use like this: killtty pts/tnb pts/tr pts/tD here it is #!/usr/bin/ksh i=1 for i do || exit kill -9 `ps -ft "${i}" |... (9 Replies)
Discussion started by: vascobrito
9 Replies

2. UNIX for Dummies Questions & Answers

tty problem

Dear all, when I do a remote shell command from a FUJITSU Unix to an HP-UX, I always get this: 15:36:35 + rsh -l storto obs2 sh /users/obs/storto/MESO-NH/tmp_olive_map_00CC/job_prepex_70JY_C00CC_20041103_19 Not a terminal stty: : Erreur inconnue stty: : Erreur inconnue... (0 Replies)
Discussion started by: stortignauz
0 Replies

3. AIX

tty

Hi All can anyone tell me what is the meaning of tty,or give me an example of this? (1 Reply)
Discussion started by: magasem
1 Replies

4. AIX

Tty Over Run

dears i have two IBM p630 application servers, they are running hacmp 5.2 as the clustering software. from the output of errpt on one of the nodes i am receiving the following error: 9D30B78E 0530020007 T S tty1 RECEIVER OVER-RUN ON INPUT please are there any ideas about how... (0 Replies)
Discussion started by: TheEngineer
0 Replies

5. Programming

Posix

HI, When i am configuring php in SUN Solaris. I am getting the below error. configure: error: Your system seems to lack POSIX threads. Do i need to install POSIX? If so can somebody let me know where can i download POSIX for Solaris 8? Thanks, (2 Replies)
Discussion started by: Krrishv
2 Replies

6. Solaris

tty hack

hi all, what i want to do when user open terminal like tty5 and do his work i want to see his terminal how can i do this (1 Reply)
Discussion started by: xxmasrawy
1 Replies

7. UNIX for Advanced & Expert Users

tty changes?

I am not sure if I am using the correct terminology but somehow my tty keeps changing on me. The man pages are confusing to me on what exactly the tty is. This is what I see when I run the tty command. Could anyone explain why my tty keeps changing? ~ $ tty /dev/pts/1 ~ $ tty /dev/pts/0 (6 Replies)
Discussion started by: cokedude
6 Replies

8. Ubuntu

How to get columns TIME and TTY of commands ps -A?

Hi, Commands ps -A include four parameters are PID, TTY, TIME and CMD. I can not found pathnames of TTY and TIME which I can read from file in C language to get information display on screen. Thank you! Ex: PID TTY TIME CMD 1 ? 00:00:01 init (2 Replies)
Discussion started by: newbie_member
2 Replies

9. Shell Programming and Scripting

Python: Redirecting to tty and reading from tty

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
getusershell(3) 					     Library Functions Manual						   getusershell(3)

NAME
getusershell, getusershell_r, setusershell, setusershell_r, endusershell, endusershell_r - Get the names of legal user shells LIBRARY
Standard C Library (libc.a) SYNOPSIS
char *getusershell(void); int setusershell(void); int endusershell(void); The following obsolete functions are supported in order to maintain backward compatibility with previous versions of the operating system. You should not use them in new designs. int getusershell_r( char *shell, int len unsigned int *state); int setusershell_r( unsigned int *state); int endusershell_r( unsigned int *state); PARAMETERS
Points to a buffer for the shell name. Specifies the length of the shell parameter. Points to a variable which stores information about the contents of the /etc/shells file. DESCRIPTION
The getusershell() function returns a pointer to a string that contains the name of a legal user shell as defined by the system manager in the /etc/shells file. If the /etc/shells file does not exist, the standard system shells are returned. On subsequent calls, the getusershell() function returns the next shell. The endusershell() function resets the list so that subsequent calls of getusershell() reread the list from /etc/shells. The setusershell() function rereads the list from /etc/shells and subsequent calls of getusershell() start from the beginning. NOTES
The getusershell() function returns a pointer to thread-specific data. Subsequent calls to the function from the same thread overwrite this data. The getusershell_r(), setusershell_r(), and endusershell_r() functions are obsolete reentrant versions of the getusershell(), setuser- shell(), and endusershell() functions. They are supported in order to maintain backward compatibility with previous versions of the oper- ating system and should not be used in new designs. Note that you must initialize the state parameter to 0 (zero) before its first access by any of these functions. RETURN VALUES
Upon successful completion, the getusershell() function returns a pointer to a character string. If it fails or reaches the end of the shell file, it returns a null pointer. Upon successful completion, the getusershell_r() function stores a pointer to the shell name in shell and returns a value of 0 (zero). Upon failure, it returns a value of -1 and places an appropriate value in the errno variable. Upon successful completion, the setusershell_r() function returns a value of 0 (zero). Upon failure, it returns a value of -1 and places an appropriate value in the errno variable. The endusershell_r() function always returns a value of 0 (zero). ERRORS
If any of the following conditions occurs, the getusershell_r() function sets errno to the corresponding value: Either the shell parameter is invalid, the len parameter is too small, or the state parameter is a null pointer. The end of the shell list has been reached (EOF). If the following condition occurs, the setusershell_r() function sets errno to the corresponding value: Unable to allocate memory for the reread list of shells. FILES
Contains the names of legal user shells. RELATED INFORMATION
Files: shells(4). delim off getusershell(3)
All times are GMT -4. The time now is 02:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy