GNU bug report logs -
#35564
27.0.50; [PATCH] Tweak dired-do-shell-command warning about "wildcard" characters
Previous Next
Reported by: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Date: Sat, 4 May 2019 18:03:02 UTC
Severity: normal
Tags: fixed, moreinfo, patch
Merged with 28969
Found in version 27.0.50
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> 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
This bug report was last modified 4 years and 296 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.