#!/bin/bash FILES=~/goprograms/compiletest/*.go for f in $FILES do echo "Processing $f file..." # take action on each file. $f stores current file name # cat $f 6g $f >> compout done