public inbox for speakup@linux-speakup.org
 help / color / mirror / Atom feed
* re: for command
@  Tyler Spivey
   ` Saqib Shaikh
  0 siblings, 1 reply; 2+ messages in thread
From: Tyler Spivey @  UTC (permalink / raw)
  To: speakup

an example: to tail all the files in the current directory,
you can do tail *, also:
for i in *; do tail $i;done
you can do (in bash):
help for
and it gives you:
for: for NAME [in WORDS ... ;] do COMMANDS; done
    The `for' loop executes a sequence of commands for each member in a
    list of items.  If `in WORDS ...;' is not present, then `in "$@"' is
    assumed.  For each element in WORDS, NAME is set to that element, and
    the COMMANDS are executed.
so,
for i in *.txt;do cat "testing" >>$i;done
would append "Testing" to the files in the current directory ending with .txt.
hope this helps.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~ UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
 for command Tyler Spivey
 ` Saqib Shaikh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).