[GRASS-user] Renaming many files with one command
Vincent Bain
bain at toraval.fr
Sat Mar 18 11:17:10 PDT 2017
Oops sorry to all for my very noisy replies...
I just see you omitted the 's' argument to sed !
We've got it !
Bye,
Vincent.
Le samedi 18 mars 2017 à 10:45 -0700, Rich Shepard a écrit :
> On Sat, 18 Mar 2017, Vincent Bain wrote:
>
> > Rich, this should work indeed (I just tested it down here, it works)... at
> > least if you have sed installed on your system. And also carefully mind
> > the reverse quotes(``) that enclose subprocesses.
>
> Vincent,
>
> Yes, sed is part of all linux distributions and I've used it many times in
> the past. However, it did not work here and I do use backticks to evaluate
> the string between them prior to handing the results to the preceeding
> command.
>
> Here's the verbatim command:
>
> for i in `g.list type=raster pattern=open_h_*`; do g.rename rast=$i,`echo
> $i | sed /open_h_/blocked_h_/g`; done
>
> (This all on one command line; split here to fit MUA width.)
>
> I don't see a syntax error yet it's not working here in grass-7.3.svn.
> Same error message as before for each file.
>
> Thanks,
>
> Rich
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
More information about the grass-user
mailing list