[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#35564: [PATCH v4] Tweak dired warning about "wildcard" characters
From: |
Juri Linkov |
Subject: |
bug#35564: [PATCH v4] Tweak dired warning about "wildcard" characters |
Date: |
Thu, 15 Aug 2019 23:56:23 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
> IIUC, your suggested prompt does not match what dired-do-shell-command
> actually does: the function only ever substitutes '?' if it is
> "isolated", i.e. surrounded with whitespace or backquotes. Cf. the
> docstring:
>
>> ‘*’ and ‘?’ when not surrounded by whitespace nor ‘`’ have no special
>> significance for ‘dired-do-shell-command’, and are passed through
>> normally to the shell, but you must confirm first.
I collected a short summary that shows one case is still missing
(‘!’ means Dired prompt called on the marked file, and
‘$’ is the corresponding shell command):
1. ?
! cat ?
$ cat marked
! cat ./?
Confirm--do you mean to use ‘?’ as a wildcard? (y or n) y
$ cat ./? marked
! cat ?""
Confirm--do you mean to use ‘?’ as a wildcard? (y or n) y
$ cat ? marked
! cat '?'
Confirm--do you mean to use ‘?’ as a wildcard? (y or n) y
$ cat '?' marked
cat: '?': No such file or directory
! cat ./`?`
$ cat ./marked
2. *
! cat *
$ cat marked
! cat ./*
Confirm--do you mean to use ‘*’ as a wildcard? (y or n) y
$ cat ./* marked
! cat *""
Confirm--do you mean to use ‘*’ as a wildcard? (y or n) y
$ cat * marked
! cat '*'
Confirm--do you mean to use ‘*’ as a wildcard? (y or n) y
$ cat '*' marked
cat: '*': No such file or directory
Now the missing case - how to do the same that ‘cat ./`?`’ does,
i.e. how to substitute ‘*’ by marked files in such Dired prompt:
! cat ./`*`
Confirm--do you mean to use ‘*’ as a wildcard? (y or n) y
$ cat ./`*` marked
/bin/bash: marked: command not found
cat: ./: Is a directory
Why can't it run this shell command:
$ cat ./marked