[lfs-support] Trouble changing dynamic linker in step 6.9

Firerat firer4t at googlemail.com
Tue Jan 31 03:52:36 PST 2012

On 31 January 2012 10:38, Dave H <thegenrlftw at gmail.com> wrote:
> On Tue, Jan 31, 2012 at 5:29 AM, Dave H <thegenrlftw at gmail.com> wrote:
> As for the following line,
> bash: command substitution: line 47:
> This is what i receive when i attempt to set DL.  I'm not trying to
> automate, just copying and pasting from the section 6.9 Glibc section.
> Here is exactly what is entered:
> ==========================================================================
> root:/sources/glibc-2.14.1# DL=$(readelf -l /bin/sh | sed -n 's at .*interpret.*/tools\(.*\)]$@\1 at p')
> bash: command substitution: line 53: syntax error near unexpected token `)'
> bash: command substitution: line 53: `readelf -l /bin/sh | sed -n
> 's at .*interpret.*/tools\(.*\)]$@\1 at p')'
> ==========================================================================
> Also to note: the number increments by 1 every time the command is
> issued, which is why it is 53 now in the example above.  (??)
> However, if I take DL=$ out of the picture, i get
> ==========================================================================
> root:/sources/glibc-2.14.1# readelf -l /bin/sh | sed -n 's at .*interpret.*/tools\(.*\)]$@\1 at p'
> /lib64/ld-linux-x86-64.so.2
> ==========================================================================
> So It seems I just cant set the variable DL
> Sorry and to clarify, the following lines on the page require that
> DL=/lib64/ld-linux-x86-64.so.2  .  If it isn't, Ii get errors further
> on the page.
> I'm concerned if I dont get this step right, Ill have much more
> problems later on.
You have me stumped,
The error does look like bash is trying to 'run' multiple lines ( at least 47 )

what happens if you leave off the DL=
i.e. ( one line )

$(readelf -l /bin/sh | sed -n 's at .*interpret.*/tools\(.*\)]$@\1 at p')

same kind of error?
how about

(two lines)

set -vx

$(readelf -l /bin/sh | sed -n 's at .*interpret.*/tools\(.*\)]$@\1 at p')

# use set +vx to undo those noisy flags

You could also try using ` <commands> ` instead of $( <commands> )
( not a single quote ' but the `, might be to the left of 1 )

` readelf -l /bin/sh | sed -n 's at .*interpret.*/tools\(.*\)]$@\1 at p' `

hopefully the set -vx will shed some light on it
Talented, Witty And Thoughtful .. is how most describe me.

More information about the lfs-support mailing list