D12-Anpassung
[projects.git] / tools / make / insert_build.sh
1 #!/bin/bash
2 set -e
3
4 usage="insert_build.sh <file> <build>"
5
6 # inserts _<build> before last dot of filename
7 # example: "insert_build.sh 45 foo.pdf" leads to "foo_45.pdf"
8
9 if [ $# -ne 2 ]; then
10         echo $usage
11         exit 1
12 fi
13
14 stem=${1%.*}
15 ext=${1##*.}
16
17 cp $1 ${stem}_$2.$ext
18