#!/bin/bash DEVICE="/dev/ttyACM0" for p in {0..15} do echo pass $p ./t ${DEVICE} | tee -a foo.dat sleep 8 done