HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Asynchronous/synchronous commands
Operating System - HP-UX
1826915
Members
3704
Online
109705
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
10-23-2000 06:12 AM
10-23-2000 06:12 AM
Sorry if this group is not the correct but I have not found any shell group.
I am interested in execute synchronous commands from kshell-script in a asynchronuos mode. I mean, launch them ( with exec?) wait a time a see the results. I know the system calls mechanisms (fork , wait) but I do not know how to make it in a shell script languaje
Any idea? Thanks in advance
I am interested in execute synchronous commands from kshell-script in a asynchronuos mode. I mean, launch them ( with exec?) wait a time a see the results. I know the system calls mechanisms (fork , wait) but I do not know how to make it in a shell script languaje
Any idea? Thanks in advance
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 06:20 AM
10-23-2000 06:20 AM
Re: Asynchronous/synchronous commands
Hi,
to start in background (posix/korn shell):
command &
Waiting for terminating of command:
wait
Regards
to start in background (posix/korn shell):
command &
Waiting for terminating of command:
wait
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 06:32 AM
10-23-2000 06:32 AM
Solution
Hi, again,
in korn shell you can also do async reading:
command |&
read -p line
The |& statement executes the command in background.
With read -p you can read the output of the command.
Typically you can do this in a loop:
while read -p line
do
# do anything with the var $line
done
Regards
in korn shell you can also do async reading:
command |&
read -p line
The |& statement executes the command in background.
With read -p you can read the output of the command.
Typically you can do this in a loop:
while read -p line
do
# do anything with the var $line
done
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 06:39 AM
10-23-2000 06:39 AM
Re: Asynchronous/synchronous commands
Hi:
If you did an 'exec' of a command or of another script, within a script; or an exec of a script or a command at a shell prompt; you will never execute anything afterwards. A successful call to exec() does not return because the new program overwrites the calling program.
As Andreas said, start the process in the background and wait as necessary.
...JRF...
If you did an 'exec' of a command or of another script, within a script; or an exec of a script or a command at a shell prompt; you will never execute anything afterwards. A successful call to exec() does not return because the new program overwrites the calling program.
As Andreas said, start the process in the background and wait as necessary.
...JRF...
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP