Date: Sat, 04 Apr 2015 18:51:52 -0400 From: Jon Radel <jon@radel.com> To: Nancy Belle <belle@antennex.com>, freebsd-questions <freebsd-questions@FreeBSD.org> Subject: Re: Chop and replace method?? Message-ID: <55206B08.8060309@radel.com> In-Reply-To: <DM__150404165507_72936215373@mail.antennex.com> References: <DM__150404113753_01984604235@mail.antennex.com><55202099.9090908@radel.com> <552021C5.3010309@gmail.com> <55203049.4010003@radel.com> <DM__150404165507_72936215373@mail.antennex.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On 4/4/15 5:58 PM, Nancy Belle wrote:
>>>> sed -i .bak 's/href=\"..\/..\/..\/archival\/archive13\//href=\"/' *.html
>>>>
> Hi Jon Radel
>
> Oops! I forgot to mention that the *.html files are in different directories and sub-directories. What do I need to add if possible to make sed work with that situation?
So many options. If you're using sh you could always do the quick and
dirty:
for i in `find . -name '*html'` ; do sed -i .bak
's/href=\"..\/..\/..\/archival\/archive13\//href=\"/' $i ; done
while in the directory under which all files you want to change reside.
Polytropon is correct that his version
sed -i .bak 's|href="../../../archival/archive13/|href="|g' *.html
is more readable, and the trailing "g" is important if you have more
than one href you need to change per line.
to combine things a bit, my current favorite for your problem as I
currently conceive it is
find . -name '*.html' -execdir sed -i .bak
's|href="../../../archival/archive13/|href="|g' {} \;
when run from the directory under which all the files live, or you could
change "find ." to "find <directory>".
List added back in.
--Jon Radel
jon@radel.com
[-- Attachment #2 --]
0 *H
010 + 0 *H
00 #SanzTgk!0
*H
0o10 USE10U
AddTrust AB1&0$UAddTrust External TTP Network1"0 UAddTrust External CA Root0
141222000000Z
200530104838Z010 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CA0"0
*H
0
zSNpRV&IQZI`zQBy"aNv#
J n=ٺ.CRC|2PȦOZϓ%{0dV*$3DiFK3@@:*S= a<UNv%!)|qvO_T{5R"=,0-1YR73i-C֥wgQ'뼥8v8ߌIs:2:=F:WtaP@?⟢! 00U#0z4&&T$T0UakᢠOg£ 0U0U0 0U%0++0U
00U 0DU=0;09753http://crl.usertrust.com/AddTrustExternalCARoot.crl05+)0'0%+0http://ocsp.usertrust.com0
*H
*nU:Uka+ #fjow^a } [jr
AX&MX"cR6}Xޫ;cs{B#ʶM>K-ػBKiۦ74{:ǟO4ne6d)5ֱqC>2Svʆ4,Jؙ
␒ZBj#!eջ~ꌅ b:,Yř38zyJ&|00sT<}k
`i
0
*H
010 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CA0
150330000000Z
180329235959Z010 UUS10U2215010 UVA10USpringfield10U 6917 Ridgeway Dr.10U
Jon T. Radel1200U)Issued through Jon T. Radel E-PKI Manager10UCorporate Secure Email10U Jon Radel10 *H
jon@radel.com0"0
*H
0
aЩ@@g3eGރ͛; d#>q7&Hf
:3vL"jV#Xݷ>U-H[$SUڻ{Ϝ,z¶IchO=rcyrn v.Vh7k;%ueYuӬnz6!| !Aȡ+,u+
CAպF-un#vjUJWnk%j]
2JPkl 00U#0akᢠOg£ 0UE|GDp/ʚB0U0U0 0U%0++0FU ?0=0;+10+0)+https://secure.comodo.net/CPS0]UV0T0RPNLhttp://crl.comodoca.com/COMODOSHA256ClientAuthenticationandSecureEmailCA.crl0+00X+0Lhttp://crt.comodoca.com/COMODOSHA256ClientAuthenticationandSecureEmailCA.crt0$+0http://ocsp.comodoca.com0U0
jon@radel.com0
*H
KS `?H_D`8G߿VbĘ<tB-Ӈї|{'Ũݹg0Gp$%F(;*MO*gt$@ t6,?0|#ăz,&! {j2i[%b7ߪP+9G㲍["y<?8rZ'[UR6%L̤
w"=:L~Ƨ^jf36 OP1.}(e110-0010 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CAsT<}k
`i
0 + U0 *H
1 *H
0 *H
1
150404225152Z0# *H
1
\jsUc&I{{Z0l *H
1_0]0 `He*0 `He0
*H
0*H
0
*H
@0+0
*H
(0 +710010 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CAsT<}k
`i
0*H
1010 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CAsT<}k
`i
0
*H
xy%h.ӿ
yi[
$?~#j~
t's}o+?8bTΣuZ&i
s:>P\)YnUA@IR%U4Cr\Kn"u)ɕB'( >bkq4mL/R^`4nIA;bFB9`j)<o`zѥDӶ
`w8-j
g9.4
LKٟΛ$R<