while and cats

Eric "Shubes" plug at shubes.net
Mon Feb 5 10:59:37 MST 2007


Nathan Aubrey wrote:
> All,
> Is there a way to cat something while in a 'while' loop?
> example:
> 
> RADIO=(1 2 3)
> YEARS=(2007 2006)
> 
> for broadcast in "${RADIO[@]}"; do
>   if [ "$broadcast" = "${broadcast#!}" ]; then
>     for year in "${YEARS[@]}"; do
>       echo "Downloading Network List..."
>       ncftpls -x "1r" ftp://username@domain/location/$broadcast/$year/ | 
> tee /tmp/$broadcast-$year 2>&1 1>/dev/null
>         cat << EOF >> $broadcast-content.html
>           Howdy
>         EOF
>   fi
> done
> 
> It gives me an unexpected end of file.
> Sorry for any wrapping that might occur.
> 
> nathan

echo "Howdy" >>$broadcast-content.html
?

-- 
-Eric 'shubes'


More information about the PLUG-discuss mailing list