On Tuesday 13 November 2007 15:35, Chris Arnold wrote:
> It's less a BASH task than it is a sed or, perhaps, Perl one.
>
> This one's easy first go-'round:
>
>
> -==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
> targetList=(
>     # List files, either explicitly
>         one.php
>         two.php
>         foo.php
>         bar.php
>
>     # ... or by using command substitution based on "find":
>         $( find baseDir name='*.php' )
>
>     # ... or "ls":
>         $( ls $baseDir/*.php )
> )
>
> for target in "[EMAIL PROTECTED]"; do
>
>     sed \
>         --in-place=.bak \
>         -e "1s;../../wp-blog-header.php;'&';" \
>         "$target"
>
> done
> -==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
>
>
> After copying this into a .sh file and running with php files in the
> same directory, i get find: baseDir: No such file or directory
> find: name=*.php: No such file or directory
> ls: /*.php: No such file or directory

You have to fill that part in. Do you know the names of the files? If 
so, list them in the first section.

Do you have a set of "find" criteria that will produce the target files? 
If so, use that section.

Do you have a simple shell "glob" (wild-card) expression that will yield 
the proper targets? If so, use that.


You didn't give any information about which files to operate on, so 
obviously I could not make that part of the sample / example script 
definite.


> ...


Randall Schulz
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to