14-11-2023

This commit is contained in:
2023-11-14 20:35:51 +01:00
parent 5b45dc0863
commit d78f93eed2
93 changed files with 8181 additions and 538 deletions

View File

@@ -0,0 +1,82 @@
# trash
### trash
http://hasseg.org/trash/
```bash
brew install trash
```
```bash
trash <file>
```
### macos-trash
https://github.com/sindresorhus/macos-trash
```bash
brew install macos-trash
```
```bash
trash <file>
```
###
### AppleScript
```bash
osascript -e "tell application \"Finder\" to delete POSIX file \"${PWD}/${InputFile}\""
```
```bash
trash() (
: "${1:?}"
case $1 in
(/*) FNAME="$1" ;;
(*) FNAME="$(pwd)/$1"
esac
export FNAME
exec osascript <<-EOF >/dev/null
set fName to system attribute "FNAME"
tell application "Finder" to delete my (POSIX file fName)
EOF
)
```
```bash
function rem {
for b in "$@"
do
osascript -e "tell app \"Finder\" to delete POSIX file \"${PWD}/$b\""
done
}
```
```bash
trash() { mv -fv "$@" ~/.Trash/ ; }
#
```
```
/Volumes/Sharon/Windows trash Windows10_InsiderPreview_Client_ARM64_en-us_21354.vhdx
copied 'Windows10_InsiderPreview_Client_ARM64_en-us_21354.vhdx' -> '/Users/bruno/.Trash/Windows10_InsiderPreview_Client_ARM64_en-us_21354.vhdx'
removed 'Windows10_InsiderPreview_Client_ARM64_en-us_21354.vhdx'
/Volumes/Sharon/Windows 25s 09:06:33
```