- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ticker script \|/-\| .....
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
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
тАО02-19-2002 01:32 AM
тАО02-19-2002 01:32 AM
I'm looking for a script or binary that will help me stop people pressing Ctrl-C even when my scripts say please wait...!
The tool I'm thinking of is one called ticker that does this:
/
-
|
/
-
|
in the backgroup while the script runs other commands.
The output is echoed to the same line/character..
Anyone know where I can find it. I know it exists on some of the micro linux distros, but couldn't find the source/ hpux binary/script.
Later,
Bill
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2002 01:35 AM
тАО02-19-2002 01:35 AM
Re: ticker script \|/-\| .....
Trapping the signal doesn't suit your case?
trap "" 1 2 3
script
trap 1 2 3
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2002 01:45 AM
тАО02-19-2002 01:45 AM
Re: ticker script \|/-\| .....
you can do a trap like descripted before, but your problem would be, that continuos pressing of ctrl-c would break your script anyway. But if you enter a sleep- command in the action field of trap, this will no longer appear!
example:
trap 'sleep 2; : ' 1,2,3
now you can press ctrl-c several times and the script continues.
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2002 02:59 AM
тАО02-19-2002 02:59 AM
SolutionPlease try this, see if it helps:
#!/bin/ksh
function ticker
{
while [ -f /tmp/flagfile ] ;do
for char in \| / - \\ ; do
echo $char |awk '{printf ("%s\b",$0) }'
sleep 1
done
done
}
echo hello
echo please wait...
trap "" 2
touch /tmp/flagfile
ticker &
echo trap disabled sleeping...
sleep 10
rm /tmp/flagfile
trap 2
echo trap enabled sleeping...
sleep 10
echo goodbye
Rgds, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2002 02:59 AM
тАО02-19-2002 02:59 AM
Re: ticker script \|/-\| .....
Do you try?
stty kill "^-" intr "^-"
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2002 04:45 AM
тАО02-19-2002 04:45 AM
Re: ticker script \|/-\| .....
Wouldn't it be better to just log the idiot off when they press ctrl-c? After a few times of that, maybe they'll learn? Pavlov's Law kicks in here, I believe?
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2002 04:52 AM
тАО02-19-2002 04:52 AM
Re: ticker script \|/-\| .....
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2002 07:57 AM
тАО02-19-2002 07:57 AM
Re: ticker script \|/-\| .....
I don't think that continuous ctrl-c can break out of the traps. Once the interrupt signal is trapped, no amount of ctrl-c will affect. I have never seen or manage to simulate a string of continuous ctrl-c's that does.
Hope this helps. Regards.
Steven Sim Kok Leong