source: research/2008-displacement/study-5.sh @ 2763

Last change on this file since 2763 was 2286, checked in by Sam Hocevar, 12 years ago
  • More scripts for part 3.
  • Implemented main.c as a seccomp bytecode for CPUShare.
  • Property svn:executable set to *
File size: 563 bytes
Line 
1#!/bin/sh
2
3set -e
4
5if [ ! -x ./main ]; then
6    make main
7fi
8
9if [ "$1" = "" ]; then
10    echo "Usage: $0 <directory>"
11    exit 1
12fi
13
14if [ ! -d "$1" ]; then
15    echo "$0: $1 is not a directory"
16    exit 1
17fi
18
19OUTPUT="$(echo "$1" | tr -d /).txt"
20echo "$0: outputting to $OUTPUT"
21
22touch "$OUTPUT"
23find $1 -type f | while read i; do
24    J="$(basename "$i")"
25    if grep -q "$J" "$OUTPUT"; then
26        continue
27    fi
28    if TMP="$(./main -5 "$i")"; then
29        echo "$TMP" >> "$OUTPUT"
30        echo "$TMP"
31    else
32        echo "@@@ FAILURE on $i @@@"
33    fi
34done
35
Note: See TracBrowser for help on using the repository browser.