07-16-2012
Do you mean the /proc directories? /proc/pid, from your example /proc/1
is the path.
However TIME comes from /var/adm/utmpx - you will have to use a structure defined in utmpx.h to read the file.
example code here:
loginacct/utmpx_login.c (from "The Linux Programming Interface")
As to the TTY, what are you trying to do?
/proc/pid/fd/0 is the tty for the process, if one exists. A ? in ps -A output means the process does not have a controlling terminal.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I've a requirement to display all the attributes of the directory which may contain directory also along with the files and additionally i need to display the versions of the files present in the directory along with the column of "ls -ltr" which will be in next column(Version)
Plz give... (2 Replies)
Discussion started by: darshang
2 Replies
2. Shell Programming and Scripting
Hello guys, I am new at shell scripting and I want to create a script that runs several commands at a time, ie: uptime, w, df -h and so on and send the output of this commands to a text file so it can be send via email at a certain time using crontab.
Any help will be much appreciated! (4 Replies)
Discussion started by: agasamapetilon
4 Replies
3. Shell Programming and Scripting
Is there a POSIX compatible way of getting the number of columns in a tty? On Linux, I can do something like:
stty -a | awk -F'' '/columns/ { print $9 }'
But will that work on AIX, Solaris, etc? (13 Replies)
Discussion started by: otheus
13 Replies
4. UNIX for Dummies Questions & Answers
how to execute more than one command at the same time in unix .. (4 Replies)
Discussion started by: hemaa
4 Replies
5. Shell Programming and Scripting
Hi @all
I have got the following problem:
I want my Master-Script to execute 2 Sub-scripts at the same time.
How can i realize that?
Thx for your help
Greez Roger (2 Replies)
Discussion started by: DarkSwiss
2 Replies
6. 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
7. Shell Programming and Scripting
Hi Experts,
I actually need to remove multiple commas within the column not the entire row. Its comma delimited file
Actually the value seems to look like 1,006,000, when we open this in notepad or word pad the value look s like “1,006,000”
Actually our Sed command removes single comma and... (7 Replies)
Discussion started by: bshivali
7 Replies
8. Shell Programming and Scripting
Hi bodies.
You think is it possible to make arrays from 2 different files in a same time and then for example compare the values in these 2 arrays or any other instruction
for example, I have:
38558 29 31
38557 28 31
38556 23 31
38555 08 31
38554 08 28
38553 21... (8 Replies)
Discussion started by: Behrouzx77
8 Replies
9. Shell Programming and Scripting
Hi guys,
I am executing a pretty long ksh script and need to time stamp every command which runs inside.
Unfortunatly 'echo date' is not the option here.
May be someone knows another way or utility which can be used to log executed command and timestamp next to it.
Thanks
PS I work in ksh88 (4 Replies)
Discussion started by: aoussenko
4 Replies
10. 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
utmpx(4) File Formats utmpx(4)
NAME
utmpx, wtmpx - utmpx and wtmpx database entry formats
SYNOPSIS
#include <utmpx.h>
/var/adm/utmpx
/var/adm/wtmpx
DESCRIPTION
The utmpx and wtmpx files are extended database files that have superseded the obsolete utmp and wtmp database files.
The utmpx database contains user access and accounting information for commands such as who(1), write(1), and login(1). The wtmpx database
contains the history of user access and accounting information for the utmpx database.
USAGE
Applications should not access these databases directly, but should use the functions described on the getutxent(3C) manual page to inter-
act with the utmpx and wtmpx databases to ensure that they are maintained consistently.
FILES
/var/adm/utmpx user access and adminstration information
/var/adm/wtmpx history of user access and adminstrative information
SEE ALSO
getutxent(3C), wait(3C)wait.h(3HEAD)
SunOS 5.10 22 Feb 1999 utmpx(4)