aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-07-07 11:15:33 +0000
committerRichard M. Stallman2002-07-07 11:15:33 +0000
commiteb18d0073b9528a7a2b6d47bd80d54101eb1ad28 (patch)
tree56f767d645e6e4c35d81ad81c90b0097b6794d1d
parent26f17e6a29865dc52a5b5e4dd2c5a9f5200fd679 (diff)
downloademacs-eb18d0073b9528a7a2b6d47bd80d54101eb1ad28.tar.gz
emacs-eb18d0073b9528a7a2b6d47bd80d54101eb1ad28.zip
Update description of * and ? for shell commands.
Mention that v uses external viewers.
-rw-r--r--man/dired.texi56
1 files changed, 35 insertions, 21 deletions
diff --git a/man/dired.texi b/man/dired.texi
index 1e1b296f522..40882d7ad22 100644
--- a/man/dired.texi
+++ b/man/dired.texi
@@ -276,12 +276,15 @@ to display the file, like the @kbd{o} command.
276@item v 276@item v
277@kindex v @r{(Dired)} 277@kindex v @r{(Dired)}
278@findex dired-view-file 278@findex dired-view-file
279View the file described on the current line, using @kbd{M-x view-file} 279View the file described on the current line, using either an external
280(@code{dired-view-file}). 280viewing program or @kbd{M-x view-file} (@code{dired-view-file}).
281 281
282Viewing a file is like visiting it, but is slanted toward moving around 282@vindex dired-view-command-alist
283in the file conveniently and does not allow changing the file. 283External viewers are used for certain file types under the control of
284@xref{Misc File Ops,View File, Miscellaneous File Operations}. 284@code{dired-view-command-alist}. Viewing a file with @code{view-file}
285is like visiting it, but is slanted toward moving around in the file
286conveniently and does not allow changing the file. @xref{Misc File
287Ops,View File, Miscellaneous File Operations}.
285 288
286@item ^ 289@item ^
287@kindex ^ @r{(Dired)} 290@kindex ^ @r{(Dired)}
@@ -658,40 +661,51 @@ command to multiple files:
658 661
659@itemize @bullet 662@itemize @bullet
660@item 663@item
661If you use @samp{*} in the shell command, then it runs just once, with 664If you use @samp{*} surrounded by whitespace in the shell command,
662the list of file names substituted for the @samp{*}. The order of file 665then the command runs just once, with the list of file names
663names is the order of appearance in the Dired buffer. 666substituted for the @samp{*}. The order of file names is the order of
667appearance in the Dired buffer.
664 668
665Thus, @kbd{! tar cf foo.tar * @key{RET}} runs @code{tar} on the entire 669Thus, @kbd{! tar cf foo.tar * @key{RET}} runs @code{tar} on the entire
666list of file names, putting them into one tar file @file{foo.tar}. 670list of file names, putting them into one tar file @file{foo.tar}.
667 671
672If you want to use @samp{*} as a shell wildcard with whitespace around
673it, write @samp{*""}. In the shell, this is equivalent to @samp{*};
674but since the @samp{*} is not surrounded by whitespace, Dired does
675not treat it specially.
676
668@item 677@item
669If the command string doesn't contain @samp{*}, then it runs once 678If the command string doesn't contain @samp{*} surrounded by
670@emph{for each file}, with the file name added at the end. 679whitespace, then it runs once @emph{for each file}. Normally the file
680name is added at the end.
671 681
672For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on each 682For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on each
673file. 683file.
674@end itemize
675 684
676What if you want to run the shell command once for each file, with the 685@item
677file name inserted in the middle? You can use @samp{?} in the command 686If the command string contains @samp{?} surrounded by whitespace, the
678instead of @samp{*}. The current file name is substituted for 687current file name is substituted for @samp{?}. You can use @samp{?}
679@samp{?}. You can use @samp{?} more than once. For instance, here is 688this way more than once in the command, and each occurrence is
680how to uuencode each file, making the output file name by appending 689replaced. For instance, here is how to uuencode each file, making the
681@samp{.uu} to the input file name: 690output file name by appending @samp{.uu} to the input file name:
682 691
683@example 692@example
684uuencode ? ? > ?.uu 693uuencode ? ? > ?.uu
685@end example 694@end example
695@end itemize
686 696
687To use the file names in a more complicated fashion, you can use a 697To iterate over the file names in a more complicated fashion, use an
688shell loop. For example, this shell command is another way to 698explicit shell loop. For example, this shell command is another way
689uuencode each file: 699to uuencode each file:
690 700
691@example 701@example
692for file in *; do uuencode "$file" "$file" >"$file".uu; done 702for file in * ; do uuencode "$file" "$file" >"$file".uu; done
693@end example 703@end example
694 704
705@noindent
706This simple example doesn't require a shell loop (you can do it
707with @samp{?}, but it illustrates the technique.
708
695The working directory for the shell command is the top-level directory 709The working directory for the shell command is the top-level directory
696of the Dired buffer. 710of the Dired buffer.
697 711