| 1 | #!/bin/sh
|
|---|
| 2 | #
|
|---|
| 3 | # Christian Reis <[email protected]>
|
|---|
| 4 | #
|
|---|
| 5 | # Moves
|
|---|
| 6 | #
|
|---|
| 7 | # Example:
|
|---|
| 8 | #
|
|---|
| 9 | # blackjesus:~> ./move-faqwiz.sh 2\.1 3\.2
|
|---|
| 10 | # Moving FAQ question 02.001 to 03.002
|
|---|
| 11 |
|
|---|
| 12 | if [ x$2 == x ]; then
|
|---|
| 13 | echo "Need 2 args: original_version final_version."
|
|---|
| 14 | exit 2
|
|---|
| 15 | fi
|
|---|
| 16 |
|
|---|
| 17 | if [ ! -d data -o ! -d data/RCS ]; then
|
|---|
| 18 | echo "Run this inside the faqwiz data/ directory's parent dir."
|
|---|
| 19 | exit 2
|
|---|
| 20 | fi
|
|---|
| 21 |
|
|---|
| 22 | function cut_n_pad() {
|
|---|
| 23 | t=`echo $1 | cut -d. -f $2`
|
|---|
| 24 | export $3=`echo $t | awk "{ tmp = \\$0; l = length(tmp); for (i = 0; i < $2-l+1; i++) { tmp = "0".tmp } print tmp }"`
|
|---|
| 25 | }
|
|---|
|
|---|