HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Cursor
Operating System - HP-UX
1834053
Members
2466
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
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
04-16-2004 01:48 AM
04-16-2004 01:48 AM
Hi,
You might have seen during some installation we will get message "Please wait" till the installation is completed. Any idea what is the logic behind the cursor rotation? I want to to include it in my script.
Thanks.
You might have seen during some installation we will get message "Please wait
Thanks.
Never quit
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 01:55 AM
04-16-2004 01:55 AM
Re: Cursor
I would guess its very simple and goes something like this.
|/-\| etc etc.
Just have this in a loop with a sleep.
Before this bit of code "trap" SIGCHLD. Do your work in the background and when your work has finished, you handle the SIGCHLD signal to get out of your loop.
|
Just have this in a loop with a sleep.
Before this bit of code "trap" SIGCHLD. Do your work in the background and when your work has finished, you handle the SIGCHLD signal to get out of your loop.
Never preceed any demonstration with anything more predictive than "watch this"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 02:12 AM
04-16-2004 02:12 AM
Solution
One of the fundmental principles of UNIX coding is to make sure that you never hardcode sequences to position the cursor. Instead, ask the terminfo database how to do something.
In this case, the trick is to store the sequence for a particular screen location, "tput cup row col" does this.
spin()
{
typeset -i10 ROW=${1}
typeset -i10 COL=${2}
shift 2
typeset CUP=$(tput cup ${ROW} ${COL})
typeset A[0]="|"
typeset A[1]="/"
typeset A[2]="+"
typeset A[3]="\\"
typeset -i10 I=0
while [[ ${I} -lt 12 ]]
do
echo "${CUP}${A[$((${I} % 4))]}${CUP}\c"
((I += 1))
sleep 1
done
return 0
} # spin
tput clear
spin 5 10
------------------------------
This should get you started.
In this case, the trick is to store the sequence for a particular screen location, "tput cup row col" does this.
spin()
{
typeset -i10 ROW=${1}
typeset -i10 COL=${2}
shift 2
typeset CUP=$(tput cup ${ROW} ${COL})
typeset A[0]="|"
typeset A[1]="/"
typeset A[2]="+"
typeset A[3]="\\"
typeset -i10 I=0
while [[ ${I} -lt 12 ]]
do
echo "${CUP}${A[$((${I} % 4))]}${CUP}\c"
((I += 1))
sleep 1
done
return 0
} # spin
tput clear
spin 5 10
------------------------------
This should get you started.
If it ain't broke, I can fix that.
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