2021-5-20,修复“特定情况下,文件绝对路径获取错误”的bug
2021-5-23,修复“无删除权限的文件,删除时没有反应”
2021-5-23版:
function FeiZhiLou(){
Array1=(${*// / })
for Value1 in ${Array1[*]}
do
if [ -e ${Value1} ]
then
Value2=$(python -c 'import os;print(os.path.abspath("'${Value1}'"))')
osascript -e'
tell application "Finder"
posix path of ((delete posix file "'${Value2}'") as unicode text)
end tell'
fi
done
}
alias rm=FeiZhiLou
将以上代码添加到~/.zshrc
效果:
2021-5-20版:
function FeiZhiLou(){
Array1=(${*// / })
for Value1 in ${Array1[*]}
do
if [ -w ${Value1} ]
then
Value2=$(python -c 'import os;print(os.path.abspath("'${Value1}'"))')
osascript -e'
tell application "Finder"
posix path of ((delete posix file "'${Value2}'") as unicode text)
end tell'
fi
done
}
alias rm=FeiZhiLou
将以上代码添加到~/.zshrc
效果:
2021-5-19旧版:
function FeiZhiLou(){
Array1=(${*// / })
for Value1 in ${Array1[*]}
do
if [ -w ${Value1} ]
then
pwd1=$(pwd)
pwd2="${pwd1}/${Value1}"
osascript <<EOF
tell application "Finder"
posix path of ((delete posix file "${pwd2}") as unicode text)
end tell
EOF
fi
done
}
alias rm=FeiZhiLou
将以上代码添加到~/.zshrc
效果: