Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Creating Script to Shutdown/Startup
Name: Deon Date: June 7, 2007 at 06:15:49 Pacific OS: AIX CPU/Ram: Intel 4GB Product: IBM
Comment:
Hi all Can someone please help creating this script. These are the commands I do line for line then it works. But in a script is get stuck after the first line su - oracle at $. I am a newbie to this please help.
su - oracle lsnrctl start export ORACLE_SID=WMSP sss startup exit
export ORACLE_SID=WMSPA sss startup exit exit
su - forte cd $FORTE_ROOT ./forteboot.sh ./bootEXE.sh exit
Name: thepubba1 Date: June 7, 2007 at 11:42:53 Pacific
Reply:
If you are doing this as root, why don't you put all your commands and variables in a script and then use:
su -c oracle /path/myscript
The way your are trying to use su will not work in a batch shell script.
0
Response Number 2
Name: LukeChi Date: June 7, 2007 at 12:15:55 Pacific
Reply:
Example #1:
su - oracle <<EOF lsnrctl start export ORACLE_SID=WMSP sqlplus "/ as sysdba" <<EOFSQL startup EOFSQL EOF
Example #2:
su - forte <<EOF cd \$FORTE_ROOT ./forteboot.sh ./bootEXE.sh EOF
Example #3:
#!/bin/ksh
su - oracle <<EOF echo \$ORACLE_SID sqlplus "/ as sysdba" <<EOFSQL spool out.lst select username from dba_users; spool off ls -l out.lst !date EOFSQL EOF
Luke Chi
0
Response Number 3
Name: LukeChi Date: June 7, 2007 at 12:18:25 Pacific
Summary: Hello - I'm trying to write an expect script to first su to another user adn then run the passwd command. I created it by using autoexpect and then modified it to take command line parameters. The p...