mirror of
https://git.56k.es/fanta/q.git
synced 2024-06-11 08:55:29 +02:00
números validos
This commit is contained in:
parent
a3dde6a662
commit
9f7599f7b4
11
q
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…
Reference in New Issue
Block a user