![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| pstat_getdisk() call doesn’t work properly in HPUX 11.31 (11i V3) | sandiworld | HP-UX | 2 | 10-25-2007 07:39 AM |
| unmount doesn't work | DISTURBED | UNIX for Dummies Questions & Answers | 2 | 07-04-2002 03:14 PM |
| grep doesn't work within shell script? | barisgultekin | Shell Programming and Scripting | 4 | 05-24-2002 11:01 AM |
| Repquota doesn't work as Cronjob?!? | b416 | UNIX for Dummies Questions & Answers | 1 | 04-14-2002 05:44 PM |
| why doesn't this work????? | token | High Level Programming | 1 | 09-20-2001 07:08 AM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
my case statement doesn't work..
CO UNixware 7.1.1
Hi friends, I have chopped my case statementt out of my .profile and put it in another script called setsid. The case statement works when run from my .profile but not from my setsid file. All that the script does is set an environmental variable based on user input. The variable is ORACLE_SID. Here is my script. Code:
#! /bin/sh echo echo "What do you want to set your ORACLE_SID to ? 1: wmsdata 2: wmstest 3: wmsctl" echo read RESPONSE DUMMY case "$RESPONSE" in 1) ORACLE_SID=wmsdata export ORACLE_SID alias pfile='cd $ORACLE_HOME/admin/wmsdata/pfile/' alias bdump='cd $ORACLE_HOME/admin/wmsdata/bdump/' alias udump='cd $ORACLE_HOME/admin/wmsdata/udump/' ;; 2) ORACLE_SID=wmstest export ORACLE_SID alias pfile='cd $ORACLE_HOME/admin/wmstest/pfile/' alias bdump='cd $ORACLE_HOME/admin/wmstest/bdump/' alias udump='cd $ORACLE_HOME/admin/wmstest/udump/' ;; 3) ORACLE_SID=wmsctl export ORACLE_SID alias pfile='cd $ORACLE_HOME/admin/wmsctl/pfile/' alias bdump='cd $ORACLE_HOME/admin/wmsctl/bdump/' alias udump='cd $ORACLE_HOME/admin/wmsctl/udump/' ;; *) ORACLE_SID=wmsdata export ORACLE_SID alias pfile='cd $ORACLE_HOME/admin/wmsdata/pfile/' alias bdump='cd $ORACLE_HOME/admin/wmsdata/bdump/' alias udump='cd $ORACLE_HOME/admin/wmsdata/udump/' ;; esac when I set -vx I notice that th list of commands associated with the reponse do run, yet the variable does not change. Please help. Thanks in advance Suresh added code tags for readability --oombera Last edited by oombera : 02-19-2004 at 11:29 AM. |
| Forum Sponsor | ||
|
|
|
|||
|
I am new to unix, but i think i can give you a small tip, sometimes tips from stupids makes great history.. LOL
I think that the variable you are setting in your script, is only available for the shell your script is creating, in order to make it available for other shells, I am not sure, but i think you can use EXPORT {variable name} at the end of the script. |