Hi I am trying to get, the "back)" option in the 2nd select statment to work.
It does not react.
To give you and idea.
links.hist.txt contains http links.
e.g:
http://www.google.com
Code:
#!/bin/bash
options=(link back quit)
PS3="Please select an option: "
select opt in "${options[@]}"
do
case "$opt" in
link)
echo "Please enter the web address you wish to view, e.g: <http://www.google.com>"
read address
echo "$address" >> "$HOME"/links.hist.txt
links -dump "$address"
;;
back)
hist=( $(head -n10 "$HOME"/links.hist.txt) quit )
select histlist in "${hist[@]}"
do
case "$histlist" in
[1-10])
links -dump
;;
quit)
exit
;;
esac
done
#printf '%s\n' "${hist[@]}"
links -dump "$address"
;;
quit)
echo "Thanks for using $0"
exit 0
;;
esac
done
This is the section that does not work, I am trying to figure out what to place on the line:
Code:
links -dump "$histlist"
This does not choose the output from the 1-10 elements selected to be used in the next command for the -dump argument....
Code:
back)
hist=( $(head -n10 "$HOME"/links.hist.txt) quit )
select histlist in "${hist[@]}"
do
case "$histlist" in
[1-10])
links -dump "$histlist"
;;
quit)
exit
Thanks for your time.