Skip to content

Instantly share code, notes, and snippets.

@david-bergstrom
Created March 11, 2015 08:47
Show Gist options
  • Save david-bergstrom/ea4106c7d35ec40d3a4c to your computer and use it in GitHub Desktop.
Save david-bergstrom/ea4106c7d35ec40d3a4c to your computer and use it in GitHub Desktop.
#!/bin/bash
cd userprog/build
COUNTER=0
while [ $COUNTER -lt 10 ]; do
echo Running the program for the $COUNTER time.
pintos -v --qemu -- -q run 'pfs' > output_$COUNTER
pintos -v --qemu -- -q cat messages > messages_$COUNTER
tail +12 messages_$COUNTER | head -313 | cut -c 60-75 | tr '\n' '\0' | tr '.' ' ' > messages_cropped_$COUNTER
echo "Number of words:"
wc messages_cropped_$COUNTER
let COUNTER=COUNTER+1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment