#! /usr/bin/env sh if [ "$1" = "--rcfile" ]; then # This means the shell should stay open after executing. So we remove the last line which contains 'exit' shift tmp="$(cat $1)" echo ${tmp%exit} > $1 cat >> $1 <