FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor


 
 
LinkBack Thread Tools
 
Old 03-04-2009, 04:14 PM
josep
 
Default sed :(

why isn't it working?

sed -i "s/#send host-name "andare.fugue.com";/send host-name $(cat /etc/hostname)/g" /etc/dhcp3/dhclient.conf
 
Old 03-04-2009, 04:19 PM
Tzafrir Cohen
 
Default sed :(

On Wed, Mar 04, 2009 at 06:14:54PM +0100, josep wrote:
> why isn't it working?
>
> sed -i "s/#send host-name "andare.fugue.com";/send host-name $(cat
> /etc/hostname)/g" /etc/dhcp3/dhclient.conf

What is it supposed to do?

What does it do in practice?

--
Tzafrir Cohen | tzafrir@jabber.org | VIM is
http://tzafrir.org.il | | a Mutt's
tzafrir@cohens.org.il | | best
ICQ# 16849754 | | friend


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-04-2009, 04:21 PM
Johannes Wiedersich
 
Default sed :(

josep wrote:
> why isn't it working?
>
> sed -i "s/#send host-name "andare.fugue.com";/send host-name $(cat
> /etc/hostname)/g" /etc/dhcp3/dhclient.conf

your quotes don't match. (There are probably other issues as well.)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-04-2009, 04:22 PM
Sjors Gielen
 
Default sed :(

josep schreef:

why isn't it working?

sed -i "s/#send host-name "andare.fugue.com
<http://andare.fugue.com>";/send host-name $(cat /etc/hostname)/g"
/etc/dhcp3/dhclient.conf




You're using quotes inside quotes. Try this:

sed -i "s/#send host-name """andare.fugue.com""";/send host-name
"""$(cat /etc/hostname)"""/g" /etc/dhcp3/dhclient.conf


You forgot quotes once, and you need to escape the quotes inside the
quotes, and in Bash you do it the way I mentioned; """.


Sjors


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-04-2009, 04:27 PM
josep
 
Default sed :(

wow ^ ^ Thanks for the quick replies




it works!
 
Old 03-04-2009, 04:31 PM
Tzafrir Cohen
 
Default sed :(

On Wed, Mar 04, 2009 at 06:21:18PM +0100, Johannes Wiedersich wrote:
> josep wrote:
> > why isn't it working?
> >
> > sed -i "s/#send host-name "andare.fugue.com";/send host-name $(cat
> > /etc/hostname)/g" /etc/dhcp3/dhclient.conf
>
> your quotes don't match. (There are probably other issues as well.)

They actually do. Perfectly.

echo "hello "world" !"

is the same as:

echo "hello world !"

Though the OP probably wanted:

echo "hello "world" !"

(As someone else in the thread already noted)

--
Tzafrir Cohen | tzafrir@jabber.org | VIM is
http://tzafrir.org.il | | a Mutt's
tzafrir@cohens.org.il | | best
ICQ# 16849754 | | friend


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 12:56 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org