Modify to use "head -$N" and "tail -n +$N" instead of "ed"
Merge branch 'not-to-use-ed'
Modify from "sh" (it's "dash" in Ubuntu) to "bash"