LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 12-06-2004, 12:41 AM   #1
obsidianblackha
LQ Newbie
 
Registered: Dec 2004
Distribution: slackware/LFS
Posts: 11

Rep: Reputation: 0
Angry problem with sed command LFS 6.0


I'm having a problem with the following command:

SPECFILE='gcc --print-file specs' &&
sed 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2@g' \
$SPECFILE > tempspecfile &&
mv -f tempspecfile $SPECFILE &&
unset SPECFILE



When i run these commands instead of doing anything it displays the data for sed as if the command syntax is wrong. I have copy and pasted as well as typed this by hand. I have checked /lib for the dynamic linker and it is in fact ld-linux.so.2. My questions are:

A. What if anything am i doing wrong?

B. What if anyone could tell me are the manual commands needed to do this by hand instead of using the script?

C. Could anybody offer any other information that i haven't thought of?

Any and all help would be appreciated.

Thanx
 
Old 12-06-2004, 11:02 AM   #2
Nobber
Member
 
Registered: Jun 2002
Location: Nova Scotia
Distribution: Debian (home), Kubuntu 7.04 (work)
Posts: 265

Rep: Reputation: 30
Re: problem with sed command LFS 6.0

It's hard to tell what's wrong, but my first guess would be that:

Quote:
SPECFILE='gcc --print-file specs' &&
should really be

SPECFILE=`gcc --print-file specs` &&

(i.e. single quotes replaced by backquotes).
 
Old 12-06-2004, 11:13 AM   #3
Nobber
Member
 
Registered: Jun 2002
Location: Nova Scotia
Distribution: Debian (home), Kubuntu 7.04 (work)
Posts: 265

Rep: Reputation: 30
Incidentally, all that script does (apparently) is replace every instance of "/lib/ld-linux.so.2" with "/tools/lib/ld-linux.so.2" in the file named by the output of the command "gcc --print-file specs". So you could fire up a text editor to do that manually if you wish.
 
Old 12-06-2004, 11:19 AM   #4
obsidianblackha
LQ Newbie
 
Registered: Dec 2004
Distribution: slackware/LFS
Posts: 11

Original Poster
Rep: Reputation: 0
Interesting possibility. Should i replace all quotes with the back quotes?
 
Old 12-06-2004, 11:23 AM   #5
Nobber
Member
 
Registered: Jun 2002
Location: Nova Scotia
Distribution: Debian (home), Kubuntu 7.04 (work)
Posts: 265

Rep: Reputation: 30
Quote:
Originally posted by obsidianblackha
Interesting possibility. Should i replace all quotes with the back quotes?
No! The single quotes in the sed command are correct.

You need backquotes only when you want to grab the output of a command. In this case, gcc --print-file specs presumably gives you the name of a file that is interesting and relevant, so the backquotes are used to get that filename into the variable SPECFILE.
 
Old 12-06-2004, 12:49 PM   #6
obsidianblackha
LQ Newbie
 
Registered: Dec 2004
Distribution: slackware/LFS
Posts: 11

Original Poster
Rep: Reputation: 0
Okay cool, i will give that a try this evenging, and let you know.
 
Old 12-07-2004, 10:31 AM   #7
obsidianblackha
LQ Newbie
 
Registered: Dec 2004
Distribution: slackware/LFS
Posts: 11

Original Poster
Rep: Reputation: 0
Everything worked perfect. Thanx
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sed command Kalyani1 Linux - Software 28 12-07-2005 11:48 AM
sed command rharris72 Programming 6 11-20-2005 08:26 PM
bash Problem with "sed" command blubbfish Linux - Newbie 3 06-01-2004 10:14 AM
sed command pazvant Linux - Software 2 05-09-2004 12:58 PM
sed command kwigibo Linux - General 3 04-21-2002 04:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 11:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration