My script doesn't work. It doesn't remember changed values of variables. I made following script:
#!/bin/bash
kon_p=100
kon_m="nothing"
cat /etc/list | grep -v '#' | while read machine priority ;
do
if [ $priority -le $kon_p ]
then
kon_p=$priority
kon_m=$machine
fi
done
echo priority machine is $kon_m with priority $kon_p
and the result is:
priority machine is nothing with priority 100
why no changes?
file "list" is following
Debian_pokus 1
debian_2 2
debian_3 3
anyone Can you help me please?
while, so the main process does not have access to them.