You are not logged in.
Pages: 1
I'm trying to modify an XFWM theme, and need to run sed to replace colors with a phrase to make it "blend in" with the GTK theme. Unfortunately, it isn't working. Can anyone help?
Here is what I am trying to run:
sed -e 's/\#E6E6E6/\#E6E6E6 s active_color_2/g' *-active.xpm
The result of that gives me something similar to running cat *-active.xpm.
Last edited by smartboyathome (2009-03-25 21:49:53)
Offline
-i[SUFFIX], --in-place[=SUFFIX]
edit files in place (makes backup if extension supplied)
So just do "sed -i -e blah".
The default is for sed just to print the input (+changes) to STDOUT.
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
Use sed -i
Make sure -i doesn't have an argument though. sed -ie '...' FILENAME will make changes to FILENAMEe.
Offline
Thanks, I'm a sed noob, first time using it.
Offline
the above should work but i'd script it:
edit that, the above will work and will work better, faster and more efficiently...
but i'd still script it
#!/bin/bash
find ./ -name '*-active.xpm' | while read file; do
cp $file $file.orig
cat $file | sed 's/\#E6E6E6/\#E6E6E6 s active_color_2/g' > temp
mv temp $file
done
Last edited by brisbin33 (2009-03-25 21:39:20)
//github/
Offline
@brisbin33: Did you know sed -i actually does that too, redirect the changes to a temporary file and move that back.
Offline
@brisbin33: Did you know sed -i actually does that too, redirect the changes to a temporary file and move that back.
yeah, i kinda figured that when i saw -i will except a suffix (.orig .bak i presume). linux thinks of everything
//github/
Offline
Pages: 1