- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- delay function in 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
Discussions
Discussions
Forums
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
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
тАО07-30-2006 01:32 PM
тАО07-30-2006 01:32 PM
If i want to delay any predefined time (e.g. $TIME) in ksh, what the best way, any command? Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2006 02:02 PM
- Tags:
- sleep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2006 02:30 PM
тАО07-30-2006 02:30 PM
Re: delay function in ksh
DELAY=15
XX=$(line -t ${DELAY})
STAT=${?} # capture status of last command
if [ ${STAT} -eq 0 ]
then
echo "Input was read; XX = ${XX}"
else
echo "No input was read; timed out"
fi
This construct will allow a script to wait for an input or take a default action if no input is received.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2006 03:31 PM
тАО07-30-2006 03:31 PM
Re: delay function in ksh
It seems command "sleep" can only have fix number argument, and couldn't able to have valuable argument.
Command "line" is ok with valuable argument, but the delay can be interruptted by keyboard.
Is this correct? any other good ideas.
Thanks a lot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2006 03:37 PM
тАО07-30-2006 03:37 PM
Re: delay function in ksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2006 03:40 PM
тАО07-30-2006 03:40 PM
Re: delay function in ksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2006 06:58 PM
тАО07-30-2006 06:58 PM
Re: delay function in ksh
Just now the scirpt failed because the valuable which sent to the sleep command is empty, so it confused me that sleep cann't follow by a valuable.
now it works. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2006 07:33 PM
тАО07-30-2006 07:33 PM
Re: delay function in ksh
the sleep command can take variables as arguments.
below a simple test:
export VAL=30
sleep $VAL
you may wish to post an extract from your script/code that is failing
kind regards
yogeeraj