On Sun, Dec 16, 2007 at 03:02:30AM -0600, Scott Lambert wrote:
> If your sed does not support the inplace argument, you will need to do 
> something like:
> 
> for file in `ls /home/devicsil/public_html/Templates` ; do
>    mv "$file" "$file.bak";
>    sed -e 's|\.\./\.\./Templates/||g' "$file.bak" > "$file";
>    echo "----------------------------------------------------------------":
> done;
> 
> I haven't run that so it may have bugs.  Test first and, as always, have
> a backup.

I should mention, if only for the newbies who might be watching,
that the above makes several assumptions about what is in
/home/devicsil/public_html/Templates, including:

1) There are no files with spaces in their name.

2) There are no subdirectories.  If there are we just renamed them to
   have a .bak extension and broke lots of stuff.

3) You don't want to change any files whose names begin with ".", i.e.
   .htaccess and friends.

If any of those assumptions are not true, you probably need to dump the
for loop and use something along the lines of:

find /home/devicsil/public_html/Templates/ -type f mumblemumble -print0 | \
  xargs -0 mumblemumble sed mumblemumble

where you might want to replace "sed" with a script that does the mv,
sed, echo stuff, if necessary.

Anyway, good luck!
-- 
Scott Lambert                    KC5MLE                       Unix SysAdmin
[EMAIL PROTECTED]



--------------------------------------------------------------------------------
WISPA Wants You! Join today!
http://signup.wispa.org/
--------------------------------------------------------------------------------
 
WISPA Wireless List: wireless@wispa.org

Subscribe/Unsubscribe:
http://lists.wispa.org/mailman/listinfo/wireless

Archives: http://lists.wispa.org/pipermail/wireless/

Reply via email to