Code Snippets/sed

From Yossi Farjoun's Homepage
Revision as of 13:43, 11 June 2010 by Yossi (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

To change a latex file from having (\ref{eq:blah}) to \eqref{eq:blah} (note the use of eq: in the label!)

   sed -e  "s/(\\\\ref{\(eq:[^}]*\)})/\\\\eqref{\1}/g" < FarjounShaeffer.tex > text.tex

Mass rename using sed

for f in * ; do n=`echo $f | sed "s/\(.?*\) 1.m4a/\1.m4a/" `; mv  "$f" "$n"; done;
Personal tools