Re: Recursive invocation of a unix command on multiple files under a directory
From: Stein Arne Storslett (sastorsl_at_THOU.SHALT.NOT.SPAM.online.no)
Date: 10/27/04
- Next message: Barry Margolin: "Re: Recursive invocation of a unix command on multiple files under a directory"
- Previous message: nimmi_srivastav_at_yahoo.com: "Recursive invocation of a unix command on multiple files under a directory"
- In reply to: nimmi_srivastav_at_yahoo.com: "Recursive invocation of a unix command on multiple files under a directory"
- Next in thread: Barry Margolin: "Re: Recursive invocation of a unix command on multiple files under a directory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 27 Oct 2004 10:04:06 GMT
<nimmi_srivastav@yahoo.com> wrote in <1098866807.487903.157250@z14g2000cwz.googlegroups.com>:
> Does anyone have a suggestion regarding the best way to recursively
> invoke the same command (for example dos2unix or chmod) on all the
> files under a directory?
>
> I started out by using find [ something like find . -type f -exec
> COMMAND {} \; ]. This approach works fine with commands that operate
> on the same file (e.g. chmod), but I am having trouble with commands
> like dos2unix that do not operate on the same file, but send their
> output to the stdout instead (i.e the filters).
FUT set to comp.unix.shell
for i in $(find . -type f)
do
ux2dos $i > $i.new
done
-- Stein Arne
- Next message: Barry Margolin: "Re: Recursive invocation of a unix command on multiple files under a directory"
- Previous message: nimmi_srivastav_at_yahoo.com: "Recursive invocation of a unix command on multiple files under a directory"
- In reply to: nimmi_srivastav_at_yahoo.com: "Recursive invocation of a unix command on multiple files under a directory"
- Next in thread: Barry Margolin: "Re: Recursive invocation of a unix command on multiple files under a directory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|