•
•
•
•
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
![]() |
•
•
Join Date: Jan 2007
Location: Maryland, USA
Posts: 1,036
Reputation:
Rep Power: 4
Solved Threads: 23
Ok so I made the following script:
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?
bash Syntax (Toggle Plain Text)
#!/bin/sh if ! ps -C screen > /dev/null then exec xterm -fg green -bg black -e screen else if ps -C xterm > /dev/null then exec xterm -fg green -bg black -e screen else exec xterm -fg green -bg black -e screen -r fi 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
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- memory management in wndows 2000 (Windows NT / 2000 / XP / 2003)
- to solve instances of size 200 in 1 minute (Computer Science and Software Design)
- JRE vs Class Instances in RAM (Java)
- GTK code uses pointer for structs and not normal instances why? (C)
- multiple program instances opening on their own (Windows NT / 2000 / XP / 2003)
- Database design - subtypes and instances of an entity (Database Design)
- Passing Class Objects, Instances (C++)
- Determining correct size of JDesktopPane (Java)
- Multiple Instances of OUTLOOK.EXE (Windows NT / 2000 / XP / 2003)
Other Threads in the Shell Scripting Forum
- Previous Thread: ksh scripting
- Next Thread: Help Needed using File command in Shell scripts



Linear Mode