<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cursor in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cursor/m-p/3250416#M175271</link>
    <description>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.&lt;BR /&gt;&lt;BR /&gt;In this case, the trick is to store the sequence for a particular screen location, "tput cup row col" does this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;spin()&lt;BR /&gt;{&lt;BR /&gt;  typeset -i10 ROW=${1}&lt;BR /&gt;  typeset -i10 COL=${2}&lt;BR /&gt;  shift 2&lt;BR /&gt;  typeset CUP=$(tput cup ${ROW} ${COL})&lt;BR /&gt;  typeset A[0]="|"&lt;BR /&gt;  typeset A[1]="/"&lt;BR /&gt;  typeset A[2]="+"&lt;BR /&gt;  typeset A[3]="\\"&lt;BR /&gt;  typeset -i10 I=0&lt;BR /&gt;  while [[ ${I} -lt 12 ]]&lt;BR /&gt;    do&lt;BR /&gt;      echo "${CUP}${A[$((${I} % 4))]}${CUP}\c"&lt;BR /&gt;      ((I += 1))&lt;BR /&gt;      sleep 1&lt;BR /&gt;    done&lt;BR /&gt;  return 0&lt;BR /&gt;} # spin&lt;BR /&gt;&lt;BR /&gt;tput clear&lt;BR /&gt;spin 5 10&lt;BR /&gt;    &lt;BR /&gt;------------------------------&lt;BR /&gt;This should get you started.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 16 Apr 2004 09:12:10 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2004-04-16T09:12:10Z</dc:date>
    <item>
      <title>Cursor</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cursor/m-p/3250414#M175269</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You might have seen during some installation we will get message "Please wait&lt;CURSOR rotation=""&gt;" till the installation is completed. Any idea what is the logic behind the cursor rotation? I want to to include it in my script.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/CURSOR&gt;</description>
      <pubDate>Fri, 16 Apr 2004 08:48:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cursor/m-p/3250414#M175269</guid>
      <dc:creator>SAM_24</dc:creator>
      <dc:date>2004-04-16T08:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cursor/m-p/3250415#M175270</link>
      <description>I would guess its very simple and goes something like this.&lt;BR /&gt; &lt;BR /&gt;|&lt;BACKSPACE&gt;/&lt;BACKSPACE&gt;-&lt;BACKSPACE&gt;\&lt;BACKSPACE&gt;|&lt;BACKSPACE&gt;  etc etc.&lt;BR /&gt; &lt;BR /&gt;Just have this in a loop with a sleep.&lt;BR /&gt; &lt;BR /&gt;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.&lt;/BACKSPACE&gt;&lt;/BACKSPACE&gt;&lt;/BACKSPACE&gt;&lt;/BACKSPACE&gt;&lt;/BACKSPACE&gt;</description>
      <pubDate>Fri, 16 Apr 2004 08:55:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cursor/m-p/3250415#M175270</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-04-16T08:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cursor/m-p/3250416#M175271</link>
      <description>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.&lt;BR /&gt;&lt;BR /&gt;In this case, the trick is to store the sequence for a particular screen location, "tput cup row col" does this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;spin()&lt;BR /&gt;{&lt;BR /&gt;  typeset -i10 ROW=${1}&lt;BR /&gt;  typeset -i10 COL=${2}&lt;BR /&gt;  shift 2&lt;BR /&gt;  typeset CUP=$(tput cup ${ROW} ${COL})&lt;BR /&gt;  typeset A[0]="|"&lt;BR /&gt;  typeset A[1]="/"&lt;BR /&gt;  typeset A[2]="+"&lt;BR /&gt;  typeset A[3]="\\"&lt;BR /&gt;  typeset -i10 I=0&lt;BR /&gt;  while [[ ${I} -lt 12 ]]&lt;BR /&gt;    do&lt;BR /&gt;      echo "${CUP}${A[$((${I} % 4))]}${CUP}\c"&lt;BR /&gt;      ((I += 1))&lt;BR /&gt;      sleep 1&lt;BR /&gt;    done&lt;BR /&gt;  return 0&lt;BR /&gt;} # spin&lt;BR /&gt;&lt;BR /&gt;tput clear&lt;BR /&gt;spin 5 10&lt;BR /&gt;    &lt;BR /&gt;------------------------------&lt;BR /&gt;This should get you started.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Apr 2004 09:12:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cursor/m-p/3250416#M175271</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-04-16T09:12:10Z</dc:date>
    </item>
  </channel>
</rss>

