- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- shell scripting
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
02-03-2005 06:35 AM
02-03-2005 06:35 AM
shell scripting
I want to achive a pause in my script.It doesnot take the pause and loop contniues to run.
I have done it in similar way long back , but now it is not working .
Is there any way to insert a pause in a loop ?
Please reply ,
Thanks in advance,
BL.
#!/bin/ksh
cat list |while read usr ;do
echo "current user is $usr"
while true
do
echo "I am in while loop"
echo "Press ny key"
read nothing
done
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2005 06:53 AM
02-03-2005 06:53 AM
Re: shell scripting
you'll need to do something like this
cat list |&
while read -p while read
do
echo "current user is $usr"
while true
do
echo "I am in while loop"
echo "Press ny key"
read nothing
done
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2005 06:55 AM
02-03-2005 06:55 AM
Re: shell scripting
should be
read the data from "cat list |"
and
while read -p usr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2005 07:00 AM
02-03-2005 07:00 AM
Re: shell scripting
I did change the loop begning like this and it started working,
for usr in `cat list`
do
while :
do
......
Thanks,
BL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2005 07:00 AM
02-03-2005 07:00 AM
Re: shell scripting
What do you mean by pause? Do you mean that
the script should wait for any user key input and
once user presses any key, it should continue or
just pause for a short time (like 2 Sec)?
If you want to wait for any use key stroke, then do
this:
---
while true
do
echo "I am in while loop"
echo "Press any key"
read
done
----
If you want to pause for short time (like 2 Sec),
then do this:
--
while true
do
echo "I am in while loop"
echo "Press any key"
sleep 2
done
----
Did I understand the question correctly?
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2005 07:04 AM
02-03-2005 07:04 AM
Re: shell scripting
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2005 07:10 AM
02-03-2005 07:10 AM
Re: shell scripting
a simple approach:
#!/usr/bin/sh
while read user
do
echo "current user is $user"
echo "Press any key:\c"
read nothing done <$1
Run the above loop.sh with your input file as $1, e.g.:
# loop.sh infile
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2005 09:03 PM
02-03-2005 09:03 PM
Re: shell scripting
pause()
{
read junk?'Press RETURN to continue.'
}
e.g.
while true
do
echo "Looping."
pause
echo "Here we go again..."
done