Matt Price <mopto...@gmail.com> writes: > Thank you so much Nick! > > I am terrible with sed and with pipes, and ended up having two problems when > trying to use this code with sed; I ended up modifying it to the following: > > for f in *.org; do > echo "* $f" >> allofem.org > # cat $f > cat $f | sed 's/^\*/**/' >> allofem.org > done > > not as elegant looking as yours, but it worked for me. >
Except that I screwed up: the sed invocations was wrong: --8<---------------cut here---------------start------------->8--- cd Assignments for f in *.org; do echo "\* $f" sed '/^\*/s//**/' $f done > Assignments.org --8<---------------cut here---------------end--------------->8--- should work (maybe I should try it out... nah, what could go wrong?) > If you need to change the levels of the headings in the files, > use a sed script instead of cat: > > sed '/^\*/s/&/**/' $f > Sorry about that. -- Nick