Re: script regular expression

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



On Thursday 09 February 2012 23:38:51 sheraz naz wrote:
> > #/bin/bash
> > for i in $(cat certificates.txt)
> > do  
> >     echo $i 
> > done
> > 

Bad practice.
> 
> Try:
> while read i;do echo $i;done < certificates.txt
> -- 

That's the right solution, but don't forget to always quote your variables "$i"

Regards

PS: you sometimes might need "read -r"

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux