The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to detect if a Windows app dies?? jimmyc Windows & DOS: Issues & Discussions 6 12-07-2006 04:31 PM
how to detect errors in unzip jasongr Shell Programming and Scripting 2 02-22-2006 11:28 AM
How to use Kill cmd when detect rogue agui UNIX for Dummies Questions & Answers 8 01-06-2004 11:02 PM
How to detect process pkanonwe Shell Programming and Scripting 2 10-18-2002 10:33 AM
Not able to detect nr of cpu in Solaris System pbonato UNIX for Dummies Questions & Answers 1 04-04-2002 09:29 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-27-2002
inquirer
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
xterm detect

i have this script that launches multiple xterm sessionon a CDE. i would like to test the xterm so that when i execute the script using an ordinary terminal it will detect that it will unable to launch the xterm and execute other script instead.

i tried using trap and exit status. maybe i am doing something wrong. pls help.

thanks,
  #2 (permalink)  
Old 11-27-2002
inquirer
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
done

i just record the process id (using $!) when i launched the application and wait for a few seconds then check it with the "ps -ef" command. since the box will automatically kill the process if it is not possible to launch the application otherwise it will register in the "ps -ef".

thanks,
  #3 (permalink)  
Old 11-27-2002
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Do you have a seperate startup file for your CDE sessions - I know old HP VUE/CDE did/does, but I'm not sure what OS you're using.

Also, a little kludge may be to check for the existance of the DISPLAY variable. In modern shells, you can do:
Code:
...
if [ -n "$DISPLAY" ]; then
  nohup xterm >/dev/ull 2>&1
fi
...
or, more portably,
Code:
...
if [ X$DISPLAY = X ]; then
  nohup xterm >/dev/null 2>&1
fi
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:10 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0