[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

38.8 Shell Commands in Dired

The Dired command ! (dired-do-shell-command) reads a shell command string in the minibuffer and runs that shell command on all the specified files. (X is a synonym for !.) You can specify the files to operate on in the usual ways for Dired commands (voir la section Operating on Files).

The working directory for the shell command is the top-level directory of the Dired buffer.

There are two ways of applying a shell command to multiple files:

To iterate over the file names in a more complicated fashion, use an explicit shell loop. For example, here is how to uuencode each file, making the output file name by appending ‘.uu’ to the input file name:

 
for file in * ; do uuencode "$file" "$file" >"$file".uu; done

The ! command does not attempt to update the Dired buffer to show new or modified files, because it doesn't understand shell commands, and does not know what files the shell command changed. Use the g command to update the Dired buffer (voir la section Updating the Dired Buffer).


[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

Ce document a été généré par Eric Reinbold le 23 Février 2009 en utilisant texi2html 1.78.