![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
| Display Modes | Rate This Thread |
|
|