diff options
Diffstat (limited to 'boca-1.5.1/doc/problemexamples')
| -rwxr-xr-x[-rw-r--r--] | boca-1.5.1/doc/problemexamples/gen_examples.sh | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/boca-1.5.1/doc/problemexamples/gen_examples.sh b/boca-1.5.1/doc/problemexamples/gen_examples.sh index e25f7e7..6f11671 100644..100755 --- a/boca-1.5.1/doc/problemexamples/gen_examples.sh +++ b/boca-1.5.1/doc/problemexamples/gen_examples.sh @@ -1,6 +1,17 @@ #!/bin/bash -rm -f keys.txt -../../src/private/createproblemzip.php abacaxi A.problem.zip password | grep -A2 "The following line" | tail -n1 >> keys.txt -../../src/private/createproblemzip.php bits B.problem.zip password | grep -A2 "The following line" | tail -n1 >> keys.txt -../../src/private/createproblemzip.php formiga C.problem.zip password | grep -A2 "The following line" | tail -n1 >> keys.txt -../../src/private/createproblemzip.php multas D.problem.zip password | grep -A2 "The following line" | tail -n1 >> keys.txt +if [ "$1" == "" ]; then + echo "CREATING FILES WITHOUT PASSWORDS" + for i in `ls`; do + if [ -d $i ]; then + cd $i; zip -r ../$i.zip .; cd -; + fi + done +else + echo "USING ARGUMENT AS PASSWORD" + rm -f keys.txt + for i in `ls`; do + if [ -d $i ]; then + ../../src/private/createproblemzip.php "$i" "$i.zip" "$1" | grep -A2 "The following line" | tail -n1 >> keys.txt + fi + done +fi |