Skip to content

Instantly share code, notes, and snippets.

@georgik
Created June 10, 2013 17:43
Show Gist options
  • Save georgik/5750758 to your computer and use it in GitHub Desktop.
Save georgik/5750758 to your computer and use it in GitHub Desktop.
Parse file, find version number and increase it. Version for Linux
#!/bin/bash
if [ -z "$1" ]; then
echo "Specify file name"
exit 1
fi
FILE="$1"
VERSION=`grep ' : "v' "$FILE" | sed -e 's/^.* : "v\([^"]*\)*".*$/\1/g' `
VERSION=$[ VERSION + 1 ]
sed -i -e 's/ : "v[^"]*"/ : "v'$VERSION'"/' "$FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment