LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sed command error - what am i doing wrong? (https://www.linuxquestions.org/questions/linux-newbie-8/sed-command-error-what-am-i-doing-wrong-649420/)

Morrighan 06-15-2008 09:15 AM

sed command error - what am i doing wrong?
 
hi

im pretty new to linux.
im trying to install BIND 9.5 on Fedora 8. Im using a tutorial to install it, but when i try to build it, it doesn't work.

Build:

cd bind-9.5.0
sed -i -e '247a #undef SO_BSDCOMPAT
'lib/isc/unix/socket.c &&
./configure --prefix=/usr --sysconfdir=/etc
--enable-threads --with-libtool &&
make

either is says: 'extra characters after command' or 'no input file'

can anyone help me?

this is the link of the tutorial: http://news.softpedia.com/news/BIND-...de-36875.shtml

jschiwal 06-15-2008 09:25 AM

It looks to me that the line got split due to the column formatting.

Change the sed line to:
sed -i -e '247a\
#undef SO_BSDCOMPAT' lib/isc/unix/socket.c &&

It appends the line given after line 247.

pixellany 06-15-2008 09:26 AM

The sed syntax is:
sed '247a stuff' filename
this means append a line containing "stuff" after line 247 of "filename". In your example, the closing single quote and the filename is on the next line. (not good)

(Sloppy of them to print the procedure in this way.)

If you really must enter commands on multiple lines, you have to "escape" the newline thusly:

sed '247a stuff'\
filename


But don't do this:
sed '247a stuff\
' filename


Bad--really confusing

Morrighan 06-15-2008 09:39 AM

thanks for the quick reply.

I modified the command like you both suggested.

it works but now it gives a new error.

it says lib/isc/unix/socket.c: permission denied, even though im logged in as root.

how is that possible?

pixellany 06-15-2008 10:08 AM

What ARE the permissions for that file? (ls -l to check)

jschiwal 06-15-2008 10:19 AM

Isn't there a bind package available for Fedora Core?

Morrighan 06-15-2008 10:33 AM

sorry

-rw-r--r-- 1 1000 1000 104052 2008-03-27 22:10 lib/isc/unix/socket.c

Morrighan 06-15-2008 10:47 AM

i didn't find any specific package for Fedora.

colucix 06-15-2008 11:12 AM

Quote:

Originally Posted by Morrighan (Post 3185370)
i didn't find any specific package for Fedora.

bind-9.5.0 is in the official distribution of Fedora 8. How did you tried to install? The Add/Remove Software tool should have found it. Or from the command line
Code:

yum install bind


All times are GMT -5. The time now is 05:43 PM.