The UNIX and Linux Forums  

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
Script needed to select and delete lower case and mixed case records abhilash mn Shell Programming and Scripting 1 03-17-2008 08:00 AM
Ignore case sensitive in Case Switch annelisa Shell Programming and Scripting 1 07-13-2006 05:36 AM
Numerical Decision pmpx Shell Programming and Scripting 3 10-09-2005 05:55 PM
Platform decision Scooter UNIX for Dummies Questions & Answers 5 11-01-2002 11:20 PM
lower case to upper case string conversion in shell script dchalavadi UNIX for Dummies Questions & Answers 3 05-29-2002 01:07 AM

 
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 01-15-2002
jpprial jpprial is offline
Registered User
  
 

Join Date: Feb 2001
Location: San Francisco
Posts: 30
decision, case, it then else?

I'm writing this script in Korn Shell, on AIX. The script will print a log file, and it needs to decide what region it's in before printing.

( the output of db2 "get instance" is either
"The current database manager instance is: db2q" or
"The current database manager instance is: db2u")

I have tried this, also an if statement, but I havent' got it to work yet, any ideas?

thanks
JP

echo "enter log number"$
read slog$
$
db2 "get instance" > reg$$$
grep "u$" reg$$ > regfile$
if [ -s regfile ]; then$
qu=u$
fi$
if [ -z regfile ]; then$
qu=q$
fi$
case $qu in $
u)$
cd /dir1/db2u/apps/log; ls|grep $slog > newlog; cat newlog|xargs cat $
$
rm newlog ;;$
q)$
cd /dir1/db2q/apps/log; ls|grep $slog > snewlog; cat snewlog|xargs cat$
rm snewlog ;;$
$
*) echo "bleh!" ;;$
esac$
$
rm reg$$; rm regfile$
 

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 08:21 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