#!/bin/bash filename='software-info.xml' if [ ! -f "$filename" ]; then echo "Could not find the file \"$filename\" in the current directory." exit 1 fi xmlstarlet ed --inplace --update '//attribute[@name="version"]' --value "." $filename