números validos

master
fanta 2 years ago
parent a3dde6a662
commit 9f7599f7b4

11
q

@ -14,12 +14,19 @@ function downloadSysList(){
}
function filterList(){
nl=$(cat /home/fanta/vms/.systems.lst | wc -l)
cat -n $vmsDir/.systems.lst | cut -d ";" -f 1,2 | tr ";" " "
echo " "
read -p "Number: " option
if [[ $option == ?(-)+([0-9]) ]] ; then
cat $vmsDir/.systems.lst | head -$option | tail -1 > $vmsDir/.systems2.lst
mv $vmsDir/.systems2.lst $vmsDir/.systems.lst
if [ "$option" -ge 1 ] && [ "$option" -le $nl ]; then
cat $vmsDir/.systems.lst | head -$option | tail -1 > $vmsDir/.systems2.lst
mv $vmsDir/.systems2.lst $vmsDir/.systems.lst
else
echo -e "\nError: Try again and enter a valid number my friend"
exit
fi
else
echo -e "\nError: Try again and enter a integer number my friend"
exit

Loading…
Cancel
Save