#!/bin/bash #formats input file and over writes the input file #saves input file as inputfile.bak #convoluted approach but useful for pedagogy #later simplify it backup=$(echo $1".bak") cp $1 $backup tempfile=temp.temp fmt < $1 > $tempfile; cp $tempfile $1; rm $tempfile