Fedora Linux Support Community & Resources Center
  #1  
Old 27th August 2008, 08:25 PM
James Board Offline
Registered User
 
Join Date: Mar 2008
Posts: 276
Easy csh question

In a csh script, what is the correct way to determine if an environment variable is set? The following code snippet works, but complains if the DISPLAY variable isn't set:

if ($DISPLAY != "") then
#Set some display stuff
endif

Jim
Reply With Quote
  #2  
Old 27th August 2008, 09:11 PM
brunson Offline
Registered User
 
Join Date: Jun 2005
Location: Westminster, Colorado
Posts: 2,304
Put double quotes around $DISPLAY.
__________________
Registered Linux User #4837
411th in line to get sued by Micro$oft
Quote:
Basically, to learn Unix you learn to understand and apply a small set of key ideas and achieve expertise by expanding both the set of ideas and your ability to apply them - Paul Murphy
Reply With Quote
  #3  
Old 28th August 2008, 01:17 AM
James Board Offline
Registered User
 
Join Date: Mar 2008
Posts: 276
Double quotes "if ("$DISPLAY") then" didn't work (syntax error).

This did work "if ($?DISPLAY) then"
Reply With Quote
  #4  
Old 28th August 2008, 02:18 AM
brunson Offline
Registered User
 
Join Date: Jun 2005
Location: Westminster, Colorado
Posts: 2,304
Yeah, that's just one of the reasons csh sucks.

http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/
__________________
Registered Linux User #4837
411th in line to get sued by Micro$oft
Quote:
Basically, to learn Unix you learn to understand and apply a small set of key ideas and achieve expertise by expanding both the set of ideas and your ability to apply them - Paul Murphy
Reply With Quote
Reply

Tags
csh, easy, question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Easy question - F11 lynnevan Using Fedora 8 14th August 2009 07:27 AM
Easy question... dmode Using Fedora 5 15th May 2007 05:55 AM
Easy Question GammaPoint Installation and Live Media 5 6th May 2007 07:54 AM
Easy help question CBribiescas Using Fedora 1 16th April 2006 10:26 PM
Easy Question--not for me though! wtw1ster Using Fedora 2 16th December 2005 04:27 AM


Current GMT-time: 11:36 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat