HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- << symbol causes error in a loop
Operating System - HP-UX
1829944
Members
2299
Online
109998
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
Forums
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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
07-21-2005 02:09 AM
07-21-2005 02:09 AM
I have a very simple shell script that connects to oracle and runs a procedure. I need to run the procedure multiple times, so I'm trying to put it in a loop. Every time I try this it chokes on the <
This works ok:
#!/usr/bin/sh
export ORACLE_SID=$1
thetime=`date +%X`
sqlplus -s "/ as sysdba" < exec time_kicker ('$thetime');
!sleep 5
!thetime=`date +%X`
exec time_kicker ('$thetime');
!sleep 5
!thetime=`date +%X`
exec time_kicker ('$thetime');
!sleep 5
!thetime=`date +%X`
quit
All I'm trying to do is run time_kicker 3 times so I put it in a loop:
#!/usr/bin/sh
export ORACLE_SID=$1
for i in 1 2 3
do
thetime=`date +%X`
sqlplus -s "/ as sysdba" < exec time_kicker ('$thetime');
!sleep 5
quit
!
done
Running this script results in "Syntax error at line 8 : `<<' is not matched"
Any ideas why that won't work in a do-done loop?
Thanks, Tim
This works ok:
#!/usr/bin/sh
export ORACLE_SID=$1
thetime=`date +%X`
sqlplus -s "/ as sysdba" <
!sleep 5
!thetime=`date +%X`
exec time_kicker ('$thetime');
!sleep 5
!thetime=`date +%X`
exec time_kicker ('$thetime');
!sleep 5
!thetime=`date +%X`
quit
All I'm trying to do is run time_kicker 3 times so I put it in a loop:
#!/usr/bin/sh
export ORACLE_SID=$1
for i in 1 2 3
do
thetime=`date +%X`
sqlplus -s "/ as sysdba" <
!sleep 5
quit
!
done
Running this script results in "Syntax error at line 8 : `<<' is not matched"
Any ideas why that won't work in a do-done loop?
Thanks, Tim
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2005 02:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2005 02:17 AM
07-21-2005 02:17 AM
Re: << symbol causes error in a loop
That did it Alan, thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2005 05:56 AM
07-21-2005 05:56 AM
Re: << symbol causes error in a loop
Just another item. On occassion using EOF (i.e. end of file) sometimes conflicts with while read loops and etc..
If these weird instances occur I have just changed the marker from EOF to something else i.e <<-TIM
cat file|while read list
do
command <<-TIM
this
that
those
TIM
done
If these weird instances occur I have just changed the marker from EOF to something else i.e <<-TIM
cat file|while read list
do
command <<-TIM
this
that
those
TIM
done
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.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP