GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   unix sed (https://gfy.com/showthread.php?t=451597)

Zester 04-03-2005 05:13 AM

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

Zester 04-03-2005 05:18 AM

Quote:

Originally Posted by Alan Greenspan

ok

than change it to this:
sed -e 's/cat/dog/g' 1.html

SMG 04-03-2005 05:26 AM

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

Zester 04-03-2005 05:32 AM

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?

Zester 04-04-2005 12:47 AM

bump 8 chars

toddler 04-04-2005 01:39 AM

http://www.student.northpark.edu/pem...d/sed1line.txt

sed is your friend. as is awk. ( or perl :) )


All times are GMT -7. The time now is 03:01 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123