chmod +x firstline echo "original line" >testfile cat testfile ./firstline "another line" testfile cat testfile
bash-2.05$ cat firstline #!/bin/sh echo "$1" | cat - "$2" >$$ mv $$ "$2" bash-2.05$ chmod +x firstline bash-2.05$ echo "original line" >testfile bash-2.05$ cat testfile original line bash-2.05$ ./firstline "another line" testfile bash-2.05$ cat testfile another line original line bash-2.05$