This should be simple, but i haven't done it before...
KSH
I am reading a file into an array and currently displaying the values to the screen. What I need to do is to display a subset of those values, likely numbered, and prompt the user to select one. When they enter the number, it retrieves the assoicated array value and outputs it to the screen. (this will be used for more complex functions later)
For example, the program is run and the first 10 rows are displayed. I select a number or hit a character to proceed to the next page. This would dump the first 10 rows and load the next 10 (into another array?) I select a value and the row associated with that value echoes to the screen.
Any suggestions are greatly appreciated.
My code so far:
#!/bin/ksh
# define array
set -A line_array
# select input file
file_name="$scripts/cb_list.dat"
# populate the array
i=0
while read file_line
do
line_array=${file_line}
let i=${i}+1
done < ${file_name}
i=0
while [ ${i} -le ${#line_array
[*]} ]
do
echo ${line_array}
let i=$i+1
done
# end of variable_define.sh
[/SIZE]