On Thu, Apr 24, 2008 at 11:12 PM, David Livesay <[log in to unmask]> wrote:
> ls notes-* | [??] | cat > notes
Ok, a bit of clarification here. UNIX is not DOS; it is the *shell*,
not the individual commands like ls, that is responsible for expanding
wildcards. The shell expands notes-* into individual files and passes
them all to the command; so your ls command above is essentially a
glorified echo command.
cat notes-*
will do what you want.
However, there are cases where you want to take a list of filenames
(or other strings) in one-per-line form and turn them into arguments
to a single command; that's what the xargs (cross-arguments) command
is for:
ls -1 notes-* | xargs cat
will also do the right thing.
--
Mark J. Reed <[log in to unmask]>