File: generate

package info (click to toggle)
libmp3splt 0.5.6-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,288 kB
  • ctags: 818
  • sloc: ansic: 14,675; sh: 9,225; makefile: 51
file content (20 lines) | stat: -rw-r--r-- 438 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# NOTE: not used by this package, but is used when working on the
# mp3splt and mp3splt-gtk packages. should only be used by me.

set -e

cp $1 $1.bak
echo cp $1.base $1
cp $1.base $1
FILE=$1
shift

while [ -n "$1" ]; do
    KEY=$(echo "$1" | awk -F= '{print $1}')
    VAL=$(echo "$1" | awk "{sub(\"$KEY=\", \"\", \$0); print}")
    echo sed -i "s/###$KEY###/$VAL/g" $FILE
    sed -i "s/###$KEY###/$VAL/g" $FILE
    shift
done