Posts Tagged ‘Scripts’

Useful Bash Scripts

Tuesday, April 7th, 2009
Bash
Image via Wikipedia

Here’s a couple of bash scripts I’ve written recently that might be of use to someone.They work well under Ubuntu, and should work under any GNU/Linux or Unix system with the suitable software installed.

Improved “svn diff” command (ignores whitespace, colour highlights output, requires colordiff) – I put it in /usr/local/bin/svndiff:

#!/bin/bash svn diff -x -w $@ | colordiff

Improved recursive grep command (greps recursively, ignores files in the .svn folders, ignores temporary files, highlights output in colour) – I put it in /usr/local/bin/grepr:

#!/bin/sh SEARCHTERM=$1; shift; find . -type f -a -not -iname "*~" -a -not -iwholename "*/.svn/*" -exec grep -H --color=auto $@ "$SEARCHTERM" "{}" \;

You might also be interested in my previous “whoops I deleted files without telling svn” post here.

Reblog this post [with Zemanta]
Bookmark and Share