Determine the character displayed on the screen at column 3, row 6 and store that character in a variable. Note that it is permissible to utilize system or language provided methods or system provided facilities, system maintained records or available buffers or system maintained display records to achieve this task, rather than query the terminal directly, if those methods are more usual for the system type or language.

 
#!/bin/ksh
 
# Determine the character displayed on the screen at column 3, row 6 and 
# store that character in a variable.
#
# Use a group of functions "shellcurses"
 
#	# Variables:
#
FPATH="/usr/local/functions/shellcurses/"
 
rst="�[0m"
red="�[31m"
whi="�[37m"
 
integer row=${1:-6} col=${2:-3}		# Allow command line row col input
 
#	# 10x10 grid of random digits
#
typeset -A grid
for ((i=0; i<10; i++)); do
	for ((j=0; j<10; j++)); do
		(( grid[${i}][${j}] = (RANDOM % 9) + 1 ))
	done
done
 
#	# Functions:
#
 
 
 ######
# main #
 ######
#	# Initialize the curses screen
#
initscr ; export MAX_LINES MAX_COLS
 
#	# Display the random number grid with target in red
#
clear
for ((i=1; i<=10; i++)); do
	for ((j=1; j<=10; j++)); do
		colr=${whi}
		(( i == row )) && (( j == col )) && colr=${red}
		mvaddstr ${i} ${j} "${colr}${grid[$((i-1))][$((j-1))]}${rst}"
	done
done
 
str=$(rtnch ${row} ${col})	# return char at (row, col) location
 
mvaddstr 12 1 "Digit at (${row},${col}) = ${str}"	# Display result
move 14 1
refresh
endwin