Unix Shell - shell char escape problem

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > June 2005 > shell char escape problem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author shell char escape problem
xah@xahlee.org

2005-06-27, 7:55 am

i have a folder with lots files names of suffix "-p.html". In the
following code, why it gives error of 139?

find . -name "*-p.html" | xargs -l -i basename -s "-p.html" {} | xargs
-l -i echo '{}-p.html' '{}-f.html'

if i make the echo part to be
echo '{}\-p.html' '{}-f.html'

then i got output names has backslashs in them, which i don't want.

All command are GNU versions except /bin/echo and /usr/bin/basename are
on OS X 10.1.3.

Thanks.

Xah
xah@xahlee.org
=E2=88=91 http://xahlee.org/

Bill Marcum

2005-06-27, 5:53 pm

On 27 Jun 2005 04:44:19 -0700, xah@xahlee.org
<xah@xahlee.org> wrote:
> i have a folder with lots files names of suffix "-p.html". In the
> following code, why it gives error of 139?
>
> find . -name "*-p.html" | xargs -l -i basename -s "-p.html" {} | xargs
> -l -i echo '{}-p.html' '{}-f.html'
>
> if i make the echo part to be
> echo '{}\-p.html' '{}-f.html'
>
> then i got output names has backslashs in them, which i don't want.
>
> All command are GNU versions except /bin/echo and /usr/bin/basename are
> on OS X 10.1.3.
>

GNU basename doesn't have a -s option, but basename {} "-p.html" might
be what you want.



--
Support Our Oops!
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com