Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

[Improvement] Support Multiple Words in $FFF_TRASH_CMD #160

Open
cmplstofB opened this issue Sep 3, 2020 · 2 comments
Open

[Improvement] Support Multiple Words in $FFF_TRASH_CMD #160

cmplstofB opened this issue Sep 3, 2020 · 2 comments

Comments

@cmplstofB
Copy link
Contributor

Hello.
I want to specify "gio trash" into the trash command variable ($FFF_TRASH_CMD), but shell regards it as a single command.

export FFF_TRASH_CMD='gio trash'

$ fff
fff: Running trash
/path/to/fff: line 522: gio trash: command not found

Would you please support multiple words in $FFF_TRASH_CMD so that users can specify commands in more flexible way?

@yellowhat
Copy link

I have the same problem, I would like to remove files/folders without moving to the trash, like:

export FFF_TRASH_CMD="rm -rf"

I think that the problem is releated to this line:

command "$FFF_TRASH_CMD" "${@:1:$#-1}"

The double quotes for $FFF_TRASH_CMD force command to consider it as an entire command, removing should work:

command $FFF_TRASH_CMD "${@:1:$#-1}"

Not sure if there is a better way.

Thanks

@lcorag
Copy link

lcorag commented Sep 25, 2022

@cmplstofB A very simple workaround is to crate an executable script invoking the command you need. For example, to use gio trash (I had the same problem),

nano fff_giotrash

the file is simply

#!/bin/sh
gio trash $1

make the script executable chmod +x fff_giotrash and available in your $PATH. Then

export FFF_TRASH_CMD="fff_giotrash"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants