#!/bin/bash
# just for ideone, because I can't create a file in /etc/
DPATH=$(mktemp)	
cat - > $DPATH

k=$(grep -o 'shard-1' $DPATH | sort -u) # shard ends by a number#
i=$(grep -o 'shard-1' $DPATH | sort -u | cut -c7)
m=$((i+1))
n="shard-$m"
sed -i "s|${k}|${n}|g" $DPATH


cat $DPATH