[GRASS-dev] problems with mkftcap
Glynn Clements
glynn at gclements.plus.com
Thu May 3 00:28:35 EDT 2007
Daniel Calvelo wrote:
> > If I take enough time to let my brain process the sed command, it
> > looks like it's something in:
> >
> > \(.*\)\.\([^.]*\):
> >
> > that is, the file extension is not optional. Spaces are OK in that.
>
> Try \(.*\)(\.\([^.]*\))?: instead.
A ? in a sed regexp is a GNU extension.
I've updated mkftcap to handle files without an extension separately:
fc-list :outline file index \
| sed -n \
-e 's!^\(.*\)/\(.*\)\.\([^.]*\): :index=0$!\2:\1/\2.\3:utf-8:!p' \
-e 's!^\(.*\)/\(.*\)\.\([^.]*\): :index=\([0-9]\+\)$!\2:\1/\2.\3|\4:utf-8:!p' \
-e 's!^\(.*\)/\(.*\): :index=0$!\2:\1/\2:utf-8:!p' \
-e 's!^\(.*\)/\(.*\): :index=\([0-9]\+\)$!\2:\1/\2|\3:utf-8:!p'
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list