Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 02 Oct 2014, 03:17
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
sed Question (FAQs answer doesn't work!)(Solved)
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
ozboomer


Joined: 04 May 2005
Posts: 93
Location: Melbourne, Australia

PostPosted: Sun 14 Aug 2005, 08:21    Post_subject:  sed Question (FAQs answer doesn't work!)(Solved)  

This is sending me silly...

Using puppy v1.0.1 or v1.0.4...

# tmpdir=/tmp/root
# echo /root/etc/hosts | sed 's/root/abc/'

...gives /abc/etc/hosts

# echo /root/etc/hosts | sed 's/root/$tmpdir/'

...gives /$tmpdir/etc/hosts

# echo /root/etc/hosts | sed "s/root/$tmpdir/"

...gives "sed: -e expression #1, char 9: Unknown option to 's'"

The sed FAQs suggest the variable substitution happens when the double-quotes are used... but all I get is the syntax error.

Gnu sed v4.0.7 is included in both Puppy v1.0.1 and v1.0.4.

What do I have to do to get the variable substitution to work!?


John
Back to top
View user's profile Send_private_message 
Guest
Guest


PostPosted: Sun 14 Aug 2005, 09:18    Post_subject:  

tmpdir=/tmp/root
echo /root/etc/hosts | sed "s%/root%$tmpdir%"
Back to top
ozboomer


Joined: 04 May 2005
Posts: 93
Location: Melbourne, Australia

PostPosted: Sun 14 Aug 2005, 09:35    Post_subject:  

Anonymous wrote:
tmpdir=/tmp/root
echo /root/etc/hosts | sed "s%/root%$tmpdir%"

Great. Many thanks. Forgot all about the other delimiters Smile
Back to top
View user's profile Send_private_message 
Guest
Guest


PostPosted: Sun 14 Aug 2005, 09:47    Post_subject:  

got beaten to the punch
Back to top
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11083
Location: Arizona USA

PostPosted: Sun 14 Aug 2005, 20:00    Post_subject:  

Bladehunter: isn't it worth answering all those easy questions to find one like this one? Smile
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0420s ][ Queries: 12 (0.0038s) ][ GZIP on ]