出现奇怪的错误
基本上这个脚本删除了在serverpath=/home/gyke69/Desktop/中搜索。ipa文件的搜索,它删除了。ipa &.ipa。在列表中选择列表文件
find: paths必须在expression: 'delete'之前
find:谓词' type'后可能没有引号的模式?
#!/bin/bash
basedir=/home/gyke69/Desktop/zadmin-update/
serverpath=/home/gyke69/Desktop/
#!/bin/bash
prompt="Please select a file:"
options=( $(find $serverpath -type f -name "*.ipa" -printf "%fn") )
PS3="$prompt "
select opt in "${options[@]}" "Quit" ; do
if (( REPLY == 1 + ${#options[@]} )) ; then
exit
elif (( REPLY > 0 && REPLY <= ${#options[@]} )) ; then
echo "You picked $opt which is file $REPLY"
break
else
echo "Invalid option. Try another one."
fi
done
find $basedir -name $opt -type f -delete
find $basedir -name $opt.ipa.plist -type f delete
看起来只是最后一行代码中的一个打字错误。在删除之前你没有放-