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
NEW: need help with nawk using -v vars wakhan Shell Programming and Scripting 20 04-26-2008 04:44 AM
check list for installing solaris 9 sriny SUN Solaris 8 10-23-2006 10:54 AM
Passing Vars between scripts rcunn87 Shell Programming and Scripting 4 06-23-2006 06:07 AM
Env vars in a SED script Bags Shell Programming and Scripting 8 05-12-2006 02:53 PM
need help with nawk using -v vars amon Shell Programming and Scripting 3 01-26-2006 06:23 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-17-2008
audiophile audiophile is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 27
check a list of vars

I have about 20 different variables that I need to check for null values then replace with a specific string if they are null. I've been doing this via 20 different if then statements like this:

Code:
if [ "$VAR1" = "" ]; then
WIND="UUU"
fi
Is there a more elegant way to do this? The vars aren't sequential in their name by the way. Thanks for the suggestions as always!
 

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 11:56 AM.


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