User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,428 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,565 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 791 | Replies: 0
Reply
Join Date: Jan 2007
Location: Maryland, USA
Posts: 1,036
Reputation: Sturm is on a distinguished road 
Rep Power: 4
Solved Threads: 23
Sturm's Avatar
Sturm Sturm is offline Offline
Veteran Poster

determining instances

  #1  
Aug 18th, 2007
Ok so I made the following script:

  1. #!/bin/sh
  2.  
  3. if ! ps -C screen > /dev/null
  4. then
  5. exec xterm -fg green -bg black -e screen
  6. else
  7. if ps -C xterm > /dev/null
  8. then
  9. exec xterm -fg green -bg black -e screen
  10. else
  11. exec xterm -fg green -bg black -e screen -r
  12. fi
  13. fi

This script is run whenever I open a terminal. The problem is that on line 11 and error occurs if there are multiple screen sessions unattached screen sessions. Is there anyway to determine the pid of a
process?
"Hey ass, don't hijack my thread. This is serious." -JoshSCH
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Shell Scripting Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 1:19 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC