- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- /dev/pts - What Is It?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2007 11:27 AM
тАО05-01-2007 11:27 AM
ISINT=`tty | grep -c /dev/pts`
if [ "${ISINT}j" = "1j" ]
then
echo "Terminal session"
else
echo "From wIntegrate
When I run it twice on the same client, I obtain different results. What is /dev/pts ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2007 12:03 PM
тАО05-01-2007 12:03 PM
Re: /dev/pts - What Is It?
/dev/pts is the terminal session that is assigned to a user when logged in. If you do a ps -ef |grep pts you will see all the users and user processes on the system have a pts/XX entry where XX is an alpha numeric character.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2007 12:13 PM
тАО05-01-2007 12:13 PM
Re: /dev/pts - What Is It?
Can you change your test from 'tty|grep -c' to check for the return code instead?
Here's a new test...
tty -s
rc=$?
if [ ${rc} -eq 0 ]; then
echo "Terminal session"
elif [ ${rc} -eq 1 ];then
echo "Not a Terminal"
else
echo "unknown"
fi
Could post more detail about how you're running it when you get different results?
-denver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2007 12:19 PM
тАО05-01-2007 12:19 PM
Re: /dev/pts - What Is It?
Some of the dates on the files are year 3031.
Why am I unable to open these files with a text editor?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2007 12:55 PM
тАО05-01-2007 12:55 PM
Solution-----------------------------------------
Not precisely; just as process id's increment up to a limit and are then recycled so too are session id's.
3031 exceeds the 32-bit time representation of most flavors of UNIX but that timestamp should have nothing to do with the ability to open a file. That should be solely a function of the files mode (type + permissions); however, the ability to open a file with a text editor is a bit different still. The effects are very unpredictable when a text editor is used on non textual data and vi was never intended to be used on device files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-02-2007 03:24 AM
тАО05-02-2007 03:24 AM
Re: /dev/pts - What Is It?
What is the Unix-prompt command to obtain the client's IP address.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-02-2007 03:31 AM
тАО05-02-2007 03:31 AM
Re: /dev/pts - What Is It?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 07:09 AM
тАО12-13-2007 07:09 AM