Yeah, I have spent pretty much all day today trying to find whats wrong with my shell code. I can run the exact code in my 10.5.7, 10.5.8, and 10.6 As soon as I run the code in 10.6.1, the code doesnt work.
Here is the code I have, if anyone can help me fix it so that it works on both 10.6.1 and rest that would make my day (weekend!).
Thanks!
riz
=========
#Set Variable
export eMMC=“No_eMMC_Found”
export SD=“No_SD_Found”
export user=$(whoami)
export path=/Users/$user/Desktop/Test_Results_Detail.txt
export path_summery=/Users/$user/Desktop/Test_Results.txt
export title=“16.10 Compare song’s order on the device”
export Expected=“/Users/administrator/Desktop/Media_Sync/16 Media Sync - Transfer of Music/16.10 Compare song’s order on the device/Expected”
export failed_result=‘/Volumes/SV&V_Mac_Desktop/Automation/Mac_Desktop/Detail_Results/failed_result.txt’
export failed_data=“/Volumes/SV&V_Mac_Desktop/Automation/Mac_Desktop/Detail_Results/$title”
Scrool below to modify acutal folder if Needed
#Find which one is SD card and which one is eMMC - This also finds out the Volume name (ie. BLACKBERRY1 or BLACKBERRY2… and such)
if [ -e “/Volumes/BLACKBERRY/appdata/rim/” ]
then
export eMMC=BLACKBERRY
elif [ -e “/Volumes/BLACKBERRY/” ]
then
export SD=BLACKBERRY
fi
if [ -e “/Volumes/BLACKBERRY1/appdata/rim/” ]
then
export eMMC=BLACKBERRY1
elif [ -e “/Volumes/BLACKBERRY1/” ]
then
export SD=BLACKBERRY1
fi
if [ -e “/Volumes/BLACKBERRY2/appdata/rim/” ]
then
export eMMC=BLACKBERRY2
elif [ -e “/Volumes/BLACKBERRY2/” ]
then
export SD=BLACKBERRY2
fi
if [ -e “/Volumes/BLACKBERRY3/appdata/rim/” ]
then
export eMMC=BLACKBERRY3
elif [ -e “/Volumes/BLACKBERRY3/” ]
then
export SD=BLACKBERRY3
fi
if [ -e “/Volumes/BLACKBERRY4/appdata/rim/” ]
then
export eMMC=BLACKBERRY4
elif [ -e “/Volumes/BLACKBERRY3/” ]
then
export SD=BLACKBERRY3
fi
#Find the difference between two folders
echo $SD
echo $eMMC
export Actual=“/Volumes/$SD/BlackBerry/music/Media Sync/”
find “$Actual” . -name “.DS” -type f -exec rm -rf {} ;
find “$Expected” . -name “.DS” -type f -exec rm -rf {} ;
find “$Actual” . -name “.dat" -type f -exec rm -rf {} ;
find “$Expected” . -name ".dat” -type f -exec rm -rf {} ;
echo $SD
echo $eMMC
echo “$Actual”
echo “$Expected”
diff -r -q “$Actual” “$Expected”
diff -r “$Actual” “$Expected” &> /dev/null
if [ $? -eq 0 ]
then
time stamp the log file
echo -n date "+%Y-%m-%d @ %H:%M:%S"
>> “$path”
echo " PASSED $title" >> “$path”
echo “$title-Passed” >> “$path_summery”
echo passed
else
echo “--------------------------------------------------------------------------------------------------------------------” >> “$path”
time stamp the log file
echo -n date "+%Y-%m-%d @ %H:%M:%S"
>> “$path”
echo " FAILED $title" >> “$path”
echo “$title-Failed” >> “$path_summery”
diff -r -q “$Actual” “$Expected” >> “$path”
echo failed
echo “—” >> “$failed_result”
echo “$title” >> “$failed_result”
mkdir “$failed_data”
cp -r -f “$Actual” “$failed_data”
diff -r -q “$Actual” “$Expected” >> “$failed_result”
echo “--------------------------------------------------------------------------------------------------------------------” >> “$path”
fi
#open “$path”