diff options
| -rw-r--r-- | man/dired.texi | 56 |
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 |
| 279 | View the file described on the current line, using @kbd{M-x view-file} | 279 | View the file described on the current line, using either an external |
| 280 | (@code{dired-view-file}). | 280 | viewing program or @kbd{M-x view-file} (@code{dired-view-file}). |
| 281 | 281 | ||
| 282 | Viewing a file is like visiting it, but is slanted toward moving around | 282 | @vindex dired-view-command-alist |
| 283 | in the file conveniently and does not allow changing the file. | 283 | External 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} |
| 285 | is like visiting it, but is slanted toward moving around in the file | ||
| 286 | conveniently and does not allow changing the file. @xref{Misc File | ||
| 287 | Ops,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 |
| 661 | If you use @samp{*} in the shell command, then it runs just once, with | 664 | If you use @samp{*} surrounded by whitespace in the shell command, |
| 662 | the list of file names substituted for the @samp{*}. The order of file | 665 | then the command runs just once, with the list of file names |
| 663 | names is the order of appearance in the Dired buffer. | 666 | substituted for the @samp{*}. The order of file names is the order of |
| 667 | appearance in the Dired buffer. | ||
| 664 | 668 | ||
| 665 | Thus, @kbd{! tar cf foo.tar * @key{RET}} runs @code{tar} on the entire | 669 | Thus, @kbd{! tar cf foo.tar * @key{RET}} runs @code{tar} on the entire |
| 666 | list of file names, putting them into one tar file @file{foo.tar}. | 670 | list of file names, putting them into one tar file @file{foo.tar}. |
| 667 | 671 | ||
| 672 | If you want to use @samp{*} as a shell wildcard with whitespace around | ||
| 673 | it, write @samp{*""}. In the shell, this is equivalent to @samp{*}; | ||
| 674 | but since the @samp{*} is not surrounded by whitespace, Dired does | ||
| 675 | not treat it specially. | ||
| 676 | |||
| 668 | @item | 677 | @item |
| 669 | If the command string doesn't contain @samp{*}, then it runs once | 678 | If the command string doesn't contain @samp{*} surrounded by |
| 670 | @emph{for each file}, with the file name added at the end. | 679 | whitespace, then it runs once @emph{for each file}. Normally the file |
| 680 | name is added at the end. | ||
| 671 | 681 | ||
| 672 | For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on each | 682 | For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on each |
| 673 | file. | 683 | file. |
| 674 | @end itemize | ||
| 675 | 684 | ||
| 676 | What if you want to run the shell command once for each file, with the | 685 | @item |
| 677 | file name inserted in the middle? You can use @samp{?} in the command | 686 | If the command string contains @samp{?} surrounded by whitespace, the |
| 678 | instead of @samp{*}. The current file name is substituted for | 687 | current file name is substituted for @samp{?}. You can use @samp{?} |
| 679 | @samp{?}. You can use @samp{?} more than once. For instance, here is | 688 | this way more than once in the command, and each occurrence is |
| 680 | how to uuencode each file, making the output file name by appending | 689 | replaced. For instance, here is how to uuencode each file, making the |
| 681 | @samp{.uu} to the input file name: | 690 | output file name by appending @samp{.uu} to the input file name: |
| 682 | 691 | ||
| 683 | @example | 692 | @example |
| 684 | uuencode ? ? > ?.uu | 693 | uuencode ? ? > ?.uu |
| 685 | @end example | 694 | @end example |
| 695 | @end itemize | ||
| 686 | 696 | ||
| 687 | To use the file names in a more complicated fashion, you can use a | 697 | To iterate over the file names in a more complicated fashion, use an |
| 688 | shell loop. For example, this shell command is another way to | 698 | explicit shell loop. For example, this shell command is another way |
| 689 | uuencode each file: | 699 | to uuencode each file: |
| 690 | 700 | ||
| 691 | @example | 701 | @example |
| 692 | for file in *; do uuencode "$file" "$file" >"$file".uu; done | 702 | for file in * ; do uuencode "$file" "$file" >"$file".uu; done |
| 693 | @end example | 703 | @end example |
| 694 | 704 | ||
| 705 | @noindent | ||
| 706 | This simple example doesn't require a shell loop (you can do it | ||
| 707 | with @samp{?}, but it illustrates the technique. | ||
| 708 | |||
| 695 | The working directory for the shell command is the top-level directory | 709 | The working directory for the shell command is the top-level directory |
| 696 | of the Dired buffer. | 710 | of the Dired buffer. |
| 697 | 711 | ||