Trailing slash in custom command

Advertisement

dan
Joined:
Posts:
7
Location:
Paris, France

Trailing slash in custom command

Is there a way to write into a prompt area,
full path + selected folder (./!), if possible with trailing slash?
rsync -a --delete "!?From:?./!!" "!?To:?!"
Or add a trailing slash to command line "!/!"?
rsync -a --delete "!/!" "!?To:?!"

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: Trailing slash in custom command

Patterns cannot be used in the default value of a prompt.
Though you can implement such default using shell constructs.
FROM=!?From (keep empty for selected file):! && rsync -a --delete "${FROM:-!/!}" ...
Regarding the other question, you can again use shell tricks like:
rsync -a --delete "!/!" "!?To:?!""/"

Reply with quote

Advertisement

You can post new topics in this forum