diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2022-02-11 20:58:10 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2022-02-11 20:58:10 +0100 |
| commit | dde2e2618499ddf4c7644418f792113fbe19b955 (patch) | |
| tree | d5465042ce09417f00b53918f9f8ad1c02570cad /trash | |
| parent | bb87698ceeb625b641308e3ef48dc66b29d0f1b1 (diff) | |
| download | scripts-dde2e2618499ddf4c7644418f792113fbe19b955.tar.gz scripts-dde2e2618499ddf4c7644418f792113fbe19b955.zip | |
Added -f option to trash empty, added little security check
Diffstat (limited to 'trash')
| -rwxr-xr-x | trash | 5 |
1 files changed, 4 insertions, 1 deletions
| @@ -13,7 +13,10 @@ if [ -z "$1" ]; then | |||
| 13 | else | 13 | else |
| 14 | case "$1" in | 14 | case "$1" in |
| 15 | empty) | 15 | empty) |
| 16 | rm -r $trashfolder/* | 16 | # little check |
| 17 | if [ -n "$trashfolder" ]; then | ||
| 18 | rm -rf $trashfolder/* | ||
| 19 | fi | ||
| 17 | ;; | 20 | ;; |
| 18 | ls) | 21 | ls) |
| 19 | ls $trashfolder | 22 | ls $trashfolder |
