[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: shell script



the solution is this:

##################################################
##################################################


cat dominios.txt | while read line
do

if  (echo $line |grep "\.it" >> /dev/null )
then
echo ".";
else
echo -e "
      \nzone  \"${line}\" {
      type master;
      file  \"tuttoqui.zone\";
      allow-transfer {
             111.111.111.111;
      };
};\n" >>  named.tmp

fi


done


##################################################
##################################################

loco@finanzaemetodi.biz wrote ..
> hi I have this script:
> ##################################################
> 
> rm -f *.tmp
> 
> 
> while  read line; do echo -e "\nzone  \"${line}\" {
>       type master;
>       file  \"tuttoqui.zone\";
>       allow-transfer {
>              151.38.133.13;
>       };
> };\n" >>  named.tmp;  done < dominios.txt
> 
> 
> ##################################################
> 
> but I want jump the process whe in the  variable ${line} I have a string
> with ".it" anyting like
> ##################################################
> if (condition  ){
> 
> while  read line; do echo -e "\nzone  \"${line}\" {
>       type master;
>       file  \"${line}\";
>       allow-transfer {
>              111.111.111.111;
>       };
> };\n" >>  named.tmp;  done < dominios.txt
> }
> 
> ##################################################
> 
> tank in advance

Reply to: