HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- filename changes before previous command finishes-...
Operating System - HP-UX
1833776
Members
2128
Online
110063
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
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
10-20-2010 09:31 AM
10-20-2010 09:31 AM
filename changes before previous command finishes- BL870c
We have a Bl870c server running HP-UX 11iv2, a Oracle Database server. The attached shell script pulls a file in from a sftp server and processes the file.
The mv command to rename the file seems to execute before the previous awrun command can finish.
My assumption is that the awrun command is running on a different CPU than the mv command.
Is there a way to make shell script wait for the previous command to finish before another?
We put a sleep 10 command and it works fine.
Should we put a if [ $? = 0 ] then mv
The mv command to rename the file seems to execute before the previous awrun command can finish.
My assumption is that the awrun command is running on a different CPU than the mv command.
Is there a way to make shell script wait for the previous command to finish before another?
We put a sleep 10 command and it works fine.
Should we put a if [ $? = 0 ] then mv
- Tags:
- sftp
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2010 09:50 AM
10-20-2010 09:50 AM
Re: filename changes before previous command finishes- BL870c
Hi:
Normally, commands in a script are simply executed synchronously so that nothing begins until the previous command (process) has completed (successfully or not).
You don't say what the 'awrun' process is doing or how it is coded. If it does something like a fork() to perform work, your shell script resume execution before the work is completed.
If the simple sleep() works, you could continue to use that. If the 'awrun' returns a useful return code, then, yes, I would test it and do the 'mv' accordingly, too.
Regards!
...JRF...
Normally, commands in a script are simply executed synchronously so that nothing begins until the previous command (process) has completed (successfully or not).
You don't say what the 'awrun' process is doing or how it is coded. If it does something like a fork() to perform work, your shell script resume execution before the work is completed.
If the simple sleep() works, you could continue to use that. If the 'awrun' returns a useful return code, then, yes, I would test it and do the 'mv' accordingly, too.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2010 10:46 AM
10-20-2010 10:46 AM
Re: filename changes before previous command finishes- BL870c
>Should we put a if [ $? = 0 ]
The proper syntax (integer compare) is: [ $? -eq 0 ]
The proper syntax (integer compare) is: [ $? -eq 0 ]
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