0

Dear All,

I have just started, playing with unix shell programming.
I am in need to know, that how to get the position of cursor at unix shell.

To set the cursor position i am using command
# tput cup x y

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by dethrophes
-1

In case anybody is still looking for this .

function ReceiveCmd {
		local Reply=""
		while IFS= read -srN1 ; do 
			 [ "${REPLY}" != "${1}" ] || break
			 Reply+="${REPLY}" 
		done
		REPLY="${Reply}" 
	}
	function GetCurPos {
		echo -n $'\e[6n' ; ReceiveCmd R
		IFS=';' REPLY=( ${REPLY:2} )
	}
GetCurPos
echo ${REPLY[@]}
Votes + Comments
bad
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.