I have been exploring using sed to achieve a number of text manipulations in the course of rolling out a number of new Jekyll based websites.

Recently I have been working on streamlining the process of moving from the pre TheAudioPodcast show notes to the podcast feed notes after the show is recorded. The required differences between the files is achieved through the use of this single sed command.

 sed -e "s/v2post/post #v2post/g" -e "s_permalink: /show/\([0-9]*\)/_permalink: /show/\1.html_" $FILENAME > output-$FILENAME 

The command changes the yaml front matter in two ways. Firstly the command,

"s/v2post/post #v2post/g"

changes all values ‘v2post’ into ‘post #v2post’.

Secondly the command,

"s_permalink: /show/\([0-9]*\)/_permalink: /show/\1.html_"

changes the permalink yaml entry from ‘/show/99/’ in to ‘/show/99.html’.

The second command also demonstrated the ability to choose the command delimiter for sed. The first command uses ‘/’ while the second command uses ‘_’.

The best summary of UK election choices so far

Yesterday in the Guardian George Monbiot offered the best summary of the upcoming UK election so far.For me the highlight was this paragr...… Continue reading

Make sure your registered to vote

Published on April 23, 2017

Youtube Will Never Get Censorship Right

Published on March 21, 2017