-   Linux From Scratch (
-   -   chapter 5.7 concerns (

the2k 09-10-2006 09:12 AM

chapter 5.7 concerns
hi there,

I have just started working on my lfs installation using the live cd and it seems to have been going well until i have got to section 5.7 where i am adjusting the toolchain when i issue the command


SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs &&
gcc -dumpspecs > $SPECFILE &&
sed 's@^/lib/' $SPECFILE > tempspecfile &&
mv -vf tempspecfile $SPECFILE &&

i'm getting the error?

bash: $SPECFILE: ambiguous redirect

now as i'm using lfs to try to improve my knowledge of linux i'm not sure that this is even an error, am just hoping someone has a bit more of an idea than me.

thanks very much

Daws 09-10-2006 10:32 AM

Yes that shouldn't happen. Looks like a typo.

Please don't be insulted if I remind you that those are 5 seperate commands. I know that konsole doesn't like it if I copy and paste the entire block. To make sure it is done correctly the best thing to do is copy and paste the commands one by one, ignoring all of the "&&"

the2k 09-10-2006 03:49 PM

when i enter each of the commands in individually i'm getting the error when i type in

gcc -dumpspecs > $SPECFILE
same error as before

bash: $SPECFILE: ambiguous redirect

druuna 09-10-2006 04:11 PM


You probably used the wrong quoting in the first SPECFILE line.

SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs

Those are backtics, not single quotes.

gcc -print-libgcc-file-name is a command that needs to be executed. Try echo $SPECFILE after the first command, it should print a directory structure ending with /specs. It should not print dirname $(gcc -print-libgcc-file-name)/specs

Hope this helps.

the2k 09-10-2006 04:19 PM

that did the trick,

thankyou very much.

if i were building this on a half decent machine i would be copying and pasting from within X however X runs so badly on it that i'm not, which is good because i have just learnt something :)

druuna 09-10-2006 04:21 PM


Glad to be of service :)

penguin_powered 09-19-2006 04:18 PM

To 2K,

I've been thinking about going thru LFS somewhere down the road, but I'm really curious, "How much are you learning by going thru LFS?" Like this problem you posted, do you understand what all those commands are doing and why you're executing them?

Maybe at the end you can post an evaluation of the project, the time it took, and how much you think you got out of it for the time invested.

I bet others would find it informative, too.

Thanks and best regards as you go thru LFS, and maybe BLFS afterwards,


the2k 09-20-2006 02:38 PM

the book is quite good at explaining what you are doing and why.

however, typo's (when alcohol has been consumed!) can be a problem so i've junked the last attempt and i'm actually cheating now by building it from within xfce and copying and pasting the commands.

i think i'm learning more now that i have got onto chapter 6 than I did when I was on chapter 5.

I hope that makes a bit of sense? i'll obviously know more as to whether it has been a worthwhile learning exercise when I finish it and start messing about with it.


jkobrien 09-21-2006 04:23 PM

If I can throw in my 2 cents in response to penguin_powered. I've waded through LFS and BLFS recently - not really done yet, but are you ever?

I've found it a very useful exercise. I know what patches are now and how to apply and troubleshoot them. I have a better grip on libraries, dependencies, system configuration, and partitioning strategies. It exposed me more to the choices that are available - e.g. I finally checked out XFce. I picked up lots of little bash tips (admittedly I was a tcsh user before, so that's not surprising). And, most useful of all, the configure/make/make install cycle no longer holds any terrors for me (this isn't the same thing as saying that it always works for me, or that I always know what to do when it doesn't :) )

If I add it all up, I probably spent at least a fortnight to get my system to the point where I regarded it as useable (networking, X11). I regard this as time well spent for the reasons above. It's not something to pursue if you need a functional linux system for the day after tomorrow, I know I hardly need to say that. But if you enjoy using linux and like getting an ever deeper understanding of it and especially if, like me, you don't have a formal IT background, (B)LFS is a great exercise.


penguin_powered 10-02-2006 02:41 PM

Thanks guys for your responses! Your comments were very encouraging, John.

I plan on going thru LFS and BLFS as soon as I am able to build another machine to experiment on.

In the meantime, there's plenty to learn. John, you mentioned learning more about Bash; well, a recent Googling session landed me on a link almost 10 years old with some great Bash tricks I have not seen anywhere else. Here's the link:

bash String Manipulations Issue 18


All times are GMT -5. The time now is 08:44 AM.