Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
ok so im gonna paste some code can some one explain one thing to me. And that is where fld1 ,2 ,3 filemonth fld 5 etc come from its reading these folder/ files but...........
# File cleanup
if [ -e ftemp1$$ ]
then
cat ftemp1$$ |
while read fld1 fld2 fld3 filemonth fld5 fileyear filename fld99
do
echo "$filemonth$fileyear $filename" |
grep -v ${month[0]} | grep -v ${month[1]} |
grep -v ${month[2]} | grep -v ${month[3]} |
grep -v ${month[4]} | grep -v ${month[5]} |
grep -v ${month[6]} | grep -v ${month[7]} |
grep -v ${month[8]} | grep -v ${month[9]} |
grep -v ${month[10]}| grep -v ${month[11]} |
grep -v ${month[12]} >> ftemp2$$
done
cat ftemp2$$ |
while read fld1 filename
do
rm 2>/dev/null $filename
ls -l 2>/dev/null $filename >> $outfile
done
fi
there is more to the code and ftemp1$$ exist
everything works im just trying to understand a part of this code ...... and there is no where else where these folders/files its reading are created nor are they in the directory this script is ran from they dont exist how can you read on something that isn't there? well miswell not say that cause the script works so they must be logically created some howLearning in progress..........

this is a rather messy script. you don't need that many greps and useless cats. Just tell what are you trying to do and show by examples.

Well that is one portion of the script if i gave you whole thing this grepping makes sense
Learning in progress..........

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |