I have the understanding that using “/../” in a file location in bash will go up one level. That’s what I’m trying to do here:
for box in {0..4}
do
for lvl in {0..24}
do
key="UNLOCKED_${box}_$lvl"
plutil -key "$key" -value '1' "$appdir/../Library/Preferences/com.chillingo.cuttherope.plist" 2>&1> /dev/null
#successCheck=$(plutil -key "$key" "/$appdir/../Library/Preferences/com.chillingo.cuttherope.plist")
#if [ "$successCheck" -lt 1 ]; then
# echo "Level ${box}-$lvl failed! "
#fi
done
done
But I keep getting this error (x125):
Error: File not found at path /var/mobile/Applications/1E17CC78-AA6E-4FFA-B241-74A73FE3AB0E/CutTheRope.app/../Library/Preferences/com.chillingo.cuttherope.plist
Any help would be greatly appreciated/
Thanks.
/ means start from the root of the filesystem or context, and ../ means go up one level. /../ effectively cancels the two out.
To go up one level, try ../
EDIT: In other words, try removing the / from the end of the variable in your path.
EDIT #2: The best solution is to probably just remove the /../
EDIT #3:
This would work:
And if you removed the second Library and the .. it should also work: