- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: scripts
Operating System - HP-UX
1755680
Members
5340
Online
108837
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2002 08:24 PM
06-28-2002 08:24 PM
scripts
Could anyone solve this problem of mine :
Script a will call script b. One script b completed it should continue with the next command in script a but failed :
Script A
#!/bin/ksh
. /opt/home/scripts/profile
EXE=/opt/home/scripts
LOG=/opt/home/log
cd $LOG
rm -f test.lst
rm -f extract_test.log
rm -f ftp.dat
passwd=`cat /opt/home/.passwd`
sqlplus /nolog << ESQL
connect test/$passwd@TEST
@$EXE/test.sql < EOF
ftpToserver()
{
echo "user usera usera" > $LOG/ftp.dat
echo "lcd /opt/home/log" >> $LOG/ftp.dat
echo "cd /opt/home/test/tables/TEST" >> $LOG/ftp.dat
echo "put test.lst" >> $LOG/ftp.dat
echo "bye" >> $LOG/ftp.dat
ftp -n -i 191.191.191.191 < $LOG/ftp.dat
}
ftpToserver
Script B(test.sql)
set feedback off
set heading off
set pages 0
set lines 26
spool /opt/home/log/test.lst
select * from test;
spool off
exit
Script a will call script b. One script b completed it should continue with the next command in script a but failed :
Script A
#!/bin/ksh
. /opt/home/scripts/profile
EXE=/opt/home/scripts
LOG=/opt/home/log
cd $LOG
rm -f test.lst
rm -f extract_test.log
rm -f ftp.dat
passwd=`cat /opt/home/.passwd`
sqlplus /nolog << ESQL
connect test/$passwd@TEST
@$EXE/test.sql <
ftpToserver()
{
echo "user usera usera" > $LOG/ftp.dat
echo "lcd /opt/home/log" >> $LOG/ftp.dat
echo "cd /opt/home/test/tables/TEST" >> $LOG/ftp.dat
echo "put test.lst" >> $LOG/ftp.dat
echo "bye" >> $LOG/ftp.dat
ftp -n -i 191.191.191.191 < $LOG/ftp.dat
}
ftpToserver
Script B(test.sql)
set feedback off
set heading off
set pages 0
set lines 26
spool /opt/home/log/test.lst
select * from test;
spool off
exit
Performance Issue on HP-UX 10.20
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2002 10:39 AM
06-29-2002 10:39 AM
Re: scripts
Hi "system dude",
first the tag "ESQL" is missing in script "A".
And second, I am quite certain that you cannot nest "here documents" (input re-diretion with "< ...and it isn't even neccessary in your scripts...
passwd=`cat /opt/home/.passwd`
sqlplus /nolog << ESQL
connect test/$passwd@TEST
echo "" | @$EXE/test.sql
ESQL
Oh, and even the 'echo "" |' isn't neccessary - I did simply include it to emphasize on how to replace the "inner" here-document...
HTH,
Wodisch
first the tag "ESQL" is missing in script "A".
And second, I am quite certain that you cannot nest "here documents" (input re-diretion with "<
passwd=`cat /opt/home/.passwd`
sqlplus /nolog << ESQL
connect test/$passwd@TEST
echo "" | @$EXE/test.sql
ESQL
Oh, and even the 'echo "" |' isn't neccessary - I did simply include it to emphasize on how to replace the "inner" here-document...
HTH,
Wodisch
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP