Put this in a file (say, script), chmod +x it, then run it with: ./script [code]#!/bin/bash sleep 1; echo "When will I stop?" echo "$(tail -n 2 $0)" >> $0[/code]