Sponsored Content
Top Forums Shell Programming and Scripting Display spinning cursor while waiting Post 302225461 by Ikon on Friday 15th of August 2008 12:31:29 PM
Old 08-15-2008
this works in ksh on my HP-UX

Code:
# paste following in your script
#declare -a Spinner


#Spinner=(/ - \\ \| / - \\ \| )
set -A Spinner / - \\ \| / - \\ \|
Spinnerpos=0

update_spinner()
{
    printf "\b"${Spinner[$Spinnerpos]}
    (( Spinnerpos=(Spinnerpos +1)%8 ))
}

# testing :

printf "Spinner :  "

update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner
sleep 1
update_spinner

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Cursor Positioning

Can anyone tell me how to ouput the current cursor coordinate? I have tried using tput sc and tput rc. However I want to know what the coordinate is. Thanks. (1 Reply)
Discussion started by: bestbuyernc
1 Replies

2. UNIX for Dummies Questions & Answers

Blinking cursor

Cursor is blinking (slightly) while loading page in Firefox, or during scrolling a window. I tried some variants of linux (gnome permanently) and of course my solaris. May be an artifact of X-window? Cause in windows cursor is stable (i'm feeling more confident). PS: It makes me nervous. (0 Replies)
Discussion started by: Xcislav
0 Replies

3. Shell Programming and Scripting

scrolling cursor

Hi, I'm writing scripts in perl and shell and want to add the oprion of scrolling cursor on the screen when there is no output to the screen for long time. I saw it in some script but I don't have the source code. Are anyone know how can I perform this ? Thanks (1 Reply)
Discussion started by: Alalush
1 Replies

4. Solaris

Custom Spinning Your own Open solaris

I was wondering, If it is at all possible to spin my own custom opensolrais boot disc? The reason i ask is becausrwe i am running Open Solaris on a AMD 64 bit based system and neet flash and MPeg support right out of the box. A prompt answer Is much appreciated. (1 Reply)
Discussion started by: FloridaBSD
1 Replies

5. UNIX for Dummies Questions & Answers

Cursor position

Is there a way of finding the current cursor position (line & column) within AIX (4 Replies)
Discussion started by: gefa
4 Replies

6. Shell Programming and Scripting

Spinning bar status while doing something.

After some googling, I came across this script to create a spinning cursor: #!/bin/bash # paste following in your script declare -a Spinner Spinner=(/ - \\ \| / - \\ \| ) Spinnerpos=0 update_spinner() { printf "\b"${Spinner} (( Spinnerpos=(Spinnerpos +1)%8 )) } # testing... (2 Replies)
Discussion started by: mrwatkin
2 Replies

7. Shell Programming and Scripting

Using Cursor in Unix - How to do it (Need Help)

Hi, I have a table in which i have the following data JOB_NO FILE_ID FILE_NAME 1546148 1378788 PDF Sample -1.pdf 1546148 1378789 PDF Sample -2.pdf 1546149 1378790 PDF Sample -3.pdf Now I would like use a cursor like thing in unix to download the files using the file ids and send... (1 Reply)
Discussion started by: uuuunnnn
1 Replies

8. Shell Programming and Scripting

Getting the cursor position

I need to get the cursor position, and put it inside a variable. Problem is, i don't have the tput command, or ncurses. Apparently I was supposed to try the following: echo -e '\E But I don't get a value or anything. Please help. (3 Replies)
Discussion started by: tinman47
3 Replies

9. UNIX and Linux Applications

Passing the value of a cursor to another cursor

i have 2 cursors. i want to assign the value of first cursor(employee_id) to the where condition of cursor c2(please refer the bold statement). how do i do if i want to assign the value of c1 to where condition of cursor c2? declare cursor c1 IS select employee_id from employee cursor c2... (1 Reply)
Discussion started by: vkca
1 Replies

10. AIX

IBM P730 running AIX 7.1 (8231-E2B) - Fans spinning loud/max rpm?

We have a IBM P730 machine running AIX 7.1 in a properly air cooled server room. Just recently the fans on the unit kicked into overdrive, they are very loud and spinning at max. Typically this happens when the server first boots then they normalize. However for some odd reason, they sound... (2 Replies)
Discussion started by: c3rb3rus
2 Replies
XDefineCursor(3)						  XLIB FUNCTIONS						  XDefineCursor(3)

NAME
XDefineCursor, XUndefineCursor - define cursors SYNTAX
int XDefineCursor(Display *display, Window w, Cursor cursor); int XUndefineCursor(Display *display, Window w); ARGUMENTS
cursor Specifies the cursor that is to be displayed or None. display Specifies the connection to the X server. w Specifies the window. DESCRIPTION
If a cursor is set, it will be used when the pointer is in the window. If the cursor is None, it is equivalent to XUndefineCursor. XDefineCursor can generate BadCursor and BadWindow errors. The XUndefineCursor function undoes the effect of a previous XDefineCursor for this window. When the pointer is in the window, the par- ent's cursor will now be used. On the root window, the default cursor is restored. XUndefineCursor can generate a BadWindow error. DIAGNOSTICS
BadAlloc The server failed to allocate the requested resource or server memory. BadCursor A value for a Cursor argument does not name a defined Cursor. BadWindow A value for a Window argument does not name a defined Window. SEE ALSO
XCreateFontCursor(3), XRecolorCursor(3) Xlib - C Language X Interface X Version 11 libX11 1.3.2 XDefineCursor(3)
All times are GMT -4. The time now is 08:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy