Re: backtick help

Juergen Scholich <[email protected]>
Newsgroups gmane.comp.gnu.utils
Message-ID <[email protected]>
Hi Gisle,

I've tried the following with success:

VERSION = `grep WATTCP_VER_STRING inc/tcp.h | cut -d' ' -f4 |
sed -e 's/\"//g'`



Gisle Vanem wrote:

> I'm pulling my hairs trying to get 'sed' to work in a simple
> makefile (under MingW/MSYS/Win32). I have the following in a
> makefile:
> 
> VERSION = `grep WATTCP_VER_STRING inc/tcp.h | cut -d' ' -f4`
> ...
> show_ver:
>          @echo This is version $(VERSION)
> 
> 
> and '#define WATTCP_VER_STRING  "2.2.11"' in inc/tcp.h.
> 
> This produces the expected ' This is version "2.2.11"'. But I really need
> an output w/o the quotes. So I tried:
>   VERSION = `grep WATTCP_VER_STRING inc/tcp.h | cut -d' ' -f4 | sed -e
>   /\\"//`
> 
> This does not work however. Anybody can explain me why? What should
> the proper command be? I'm pretty lost here.
> 
> PS. The output from bash is:
>   /usr/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
>   /usr/bin/sh: -c: line 1: syntax error: unexpected end of file
> 

-- 
--
Juergen
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.