- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need Help With ksh
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
01-24-2001 10:26 AM
01-24-2001 10:26 AM
Need Help With ksh
Start SQLLDR if datafile exists
Sleep 25 mins
wakes up
check for FLAG file
If found, archive/move data, log, error and flag files to archive directory, then quit.
If flag file not found, then return to sleep for 15 mins, try again.
Keeping in mind that this is my first time using UNIX, I need to know if I'm at least on the right track. Any assistance/guidance would be greatly appreciated. Thanks.
This is what I have so far:
# ! /bin/ksh
export ORACLE_SID=XYZZ
export ORAENV_ASK=NO
. oraenv
IF (DATA=abc) THEN
sqlldr userid=xxx
control=ccc.ctl
bad=bbbb.bad
discard=dddd.dsc
log=llll.log
sleep 600
wake
ELIF (DATA != abc)THEN
sleep 1600
FI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2001 12:23 PM
01-24-2001 12:23 PM
Re: Need Help With ksh
It looks like you're on the right track, but you don't need the 'wake' command, it'll wake on it's own. Also, you can do 'else' rather than 'ELIF (DATA != abc)THEN'.
But you'll want to wrap the whole thing with a 'while' statement, otherwise it will just exit after sleeping. What I do is like this:
Kntnu=0
while [ $Kntnu -eq 0 ]
do
...all your stuff in here ...
done
Also, you'll want to put quotes around your two variable assignments, ie
export ORACLE_SID="XYZZ"
Hope this helps,
Mo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2001 12:48 PM
01-24-2001 12:48 PM
Re: Need Help With ksh
if [ $DATA = "abc" ]
then
something
elsif
something
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2001 12:52 PM
01-24-2001 12:52 PM
Re: Need Help With ksh
Mo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2001 07:11 PM
01-24-2001 07:11 PM
Re: Need Help With ksh
if [ "$DATA" = "somestring" ]
then
fi
Enclosing $DATA in double quotes will allow a null value to be compared as a zero-length string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2001 12:25 AM
01-25-2001 12:25 AM