"EOF"

Bill maltby - LFS Related lfsbill at wlmcs.com
Fri Oct 18 10:57:35 PDT 2002


On Fri, 18 Oct 2002, Ian Molton wrote:
> Has anyone noticed that using "EOF" in the book doesnt work?

Works OK.

> For example:
> 
> cat > /usr/bin/lex << "EOF"
> #!/bin/sh
> # Begin /usr/bin/lex
> 
> exec /usr/bin/flex -l "$@"
> 
> # End /usr/bin/lex
> EOF
> 
> Doesnt work at all.
> 
> I had to use:
> 
> cat > /usr/bin/lex << EOF
> #!/bin/sh
> # Begin /usr/bin/lex
> 
> exec /usr/bin/flex -l "$@"
> 
> # End /usr/bin/lex
> EOF
> 
> IE. without the quotes.

I think you want it the other way, with quotes. The quotes around "EOF"
protect from shell variable substitution. Since you are creating a script,
you don't want "$@" interpreted at that time.

I have had no problems with this at all. I suspect that the quotes around
the $@ are the problem - this will cause all the params to be seen a 1
single string by lex, instead of multiple strings, IIRC.

-- 
Bill Maltby
billm at wlmcs.com

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list