Hi all,
I have a many folders with zipped files in them. The zipped files are txt files from different folders. The txt files have the same names. If i try to
find . -type f -name "*.zip" -exec cp -R {} /myhome/ZIP \;
it fails since the ZIP files from different folders have the same names and only copies one file per name to the new location.
I have tried option 0ne
for file in `find $BASEfolder -depth -name "*.zip"`
do
new=$(unzip -l -qq $file | awk '{print $NF}')
#find $Basefolder -type f -name "*.txt"`
# Get BSC definition
HIERARCHY_3=`cat $new | grep 'SET SYS:SYSDESC' | awk -F'"' '{ print $4 }'`
# Get cell definitions
cCount=`cat $new | grep 'ADD GCELL:CELLID' | wc -l`
if [ $cCount -gt 4065 ] ;
then
echo "More cells in BSC than 4065! ($cCount)"
exit
fi
and Option 2
for file in find . -depth -name "*.zip" -exec /usr/bin/unzip -n {} \;
do
find $Basefolder -type f -name "*.txt"`
# Get BSC definition
HIERARCHY_3=`cat $file | grep 'SET SYS:SYSDESC' | awk -F'"' '{ print $4 }'`
# Get cell definitions
cCount=`cat $new | grep 'ADD GCELL:CELLID' | wc -l`
if [ $cCount -gt 4065 ] ;
then
echo "More cells in BSC than 4065! ($cCount)"
exit
fi
they both failed
Or alternatively how can I find a file in Unix and rename it with a rnadom name