Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-03-2005, 05:13 AM   #1
Zester
Confirmed User
 
Zester's Avatar
 
Industry Role:
Join Date: Jul 2003
Posts: 5,344
unix sed

what is wrong with this command:
sed -e 's/dog/cat/g' 1.html

I want to replace "dog" for "cat everywhere in the 1.html file

I get an output of the desired result to the screen and not to the file
__________________
* Mainstream ? $65 per sale
* new male contraception
Zester is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2005, 05:18 AM   #2
Zester
Confirmed User
 
Zester's Avatar
 
Industry Role:
Join Date: Jul 2003
Posts: 5,344
Quote:
Originally Posted by Alan Greenspan
ok

than change it to this:
sed -e 's/cat/dog/g' 1.html
__________________
* Mainstream ? $65 per sale
* new male contraception
Zester is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2005, 05:26 AM   #3
SMG
Confirmed User
 
Join Date: Aug 2003
Posts: 1,798
Quote:
Originally Posted by Zester
ok

than change it to this:
sed -e 's/cat/dog/g' 1.html
isnt that the same as what you typed?
I usually do
sed -e 's/cat/dog/g' 1.html > 1.html.tmp && cp -f 1.html.tmp > 1.html && rm -f 1.html.tmp
__________________
TGP Webmasters: sign up for the top 100 tgp list!
Submit galleries
If you add me to icq (title) make sure to mention GFY or I'll think you're a bot and deny you.
SMG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2005, 05:32 AM   #4
Zester
Confirmed User
 
Zester's Avatar
 
Industry Role:
Join Date: Jul 2003
Posts: 5,344
Quote:
Originally Posted by SMG
isnt that the same as what you typed?
I usually do
sed -e 's/cat/dog/g' 1.html > 1.html.tmp && cp -f 1.html.tmp > 1.html && rm -f 1.html.tmp
ok that works
but isn't there a way to do it with the temporarly file?
__________________
* Mainstream ? $65 per sale
* new male contraception
Zester is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-04-2005, 12:47 AM   #5
Zester
Confirmed User
 
Zester's Avatar
 
Industry Role:
Join Date: Jul 2003
Posts: 5,344
bump 8 chars
__________________
* Mainstream ? $65 per sale
* new male contraception
Zester is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-04-2005, 01:39 AM   #6
toddler
Confirmed User
 
Join Date: Jun 2002
Location: austin, tx
Posts: 1,911
http://www.student.northpark.edu/pem...d/sed1line.txt

sed is your friend. as is awk. ( or perl )
toddler is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.