Wizards of the Web
  • Home

Scripting

fount of useless knowledge

CLI

Sort git Config

As I was updating some gitflow config today, I noticed that my .gitconfig is a little messy. Like many things, it’s grown organically and I’ve just never thought about tidying it up. It doesn’t have to be organized, but neat and tidy files always make things more fun. Sorting .gitconfig was a bit more challenging than I was expecting. A naive sort mixes sections and values. $ cat ~/.gitconfig | sort

  • CJ Harries
    CJ Harries
CJ Harries 25 February 2018 • 4 min read
CLI

Remove Consecutive Duplicate Lines With awk

I ran into an interesting problem yesterday. At some point, while scripting updates to a collection of repos, I managed to duplicate a few lines in several files. I ended up with something like this: README.md 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 # `dotfiles-role-javascript` # `dotfiles-role-javascript` [![Build Status](https://travis-ci.org/thecjharries/dotfiles-role-javascript.svg?branch=master)](https://travis-ci.org/thecjharries/dotfiles-role-javascript) [![GitHub tag](https://img.shields.io/github/tag/thecjharries/dotfiles-role-javascript.svg)](https://github.com/thecjharries/dotfiles-role-javascript)

  • CJ Harries
    CJ Harries
CJ Harries 9 January 2018 • 4 min read
Wizards of the Web © 2018
Latest Posts Hugo Casper3 by Jonathan Janssens