Re: bash script reading directory with while and do

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



Yes!

PATH should be a reserved name, NOT to be used as a variable in scripts.

btw, what errors do you get running the script ?


On Tue, May 27, 2014 at 11:44 PM, Darr247 <darr247@xxxxxxxxx> wrote:

> On 26 May 2014 @09:12 zulu, Alberto Varesio wrote:
> > you are overwriting the PATH env variable.
> > change PATH to CLIPATH and all will work
>
>
> I don't understand, too... do you mean the script should read
>
> !/bin/bash
>
> while read line;
> do
>          read NR CLIPATH NAME<<<$(IFS=" "; echo $line)
>
>          cd /var/www/clients/
>          cp -R $CLIPATH /backup/temp/www/
>          cd /backup/temp/www/
>
>          tar cfz `date +%F`_$NAME.tar.gz web$NR/
>          mv *.tar.gz /backup/www/test/
>          rm -rf /backup/temp/www/*
>
> done < sites.txt
>
>
> instead?
> /i.e./
> replace **all** instances of "PATH" with "CLIPATH" ?
> _______________________________________________
> CentOS mailing list
> CentOS@xxxxxxxxxx
> http://lists.centos.org/mailman/listinfo/centos
>



-- 
Alberto 'JCN-9000' Varesio
*IT Administrator*
Mobile: +39 393 101 8844
LI: http://www.linkedin.com/in/albertovaresio
_______________________________________________
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