Append environment variable PATH with SED
/etc/environment
PATH="/usr/bin:/usr/local/bin"
PATH="/usr/bin:/usr/local/bin:/usr/lib/myprog/bin"
#!/bin/bash
PATHOK="`grep myprog /etc/environment`"
if [ -z $PATHOK ]; then
sed -e '/^PATH/s/"$/:\/usr\/lib\/myprog\/bin"/g' -i /etc/environment
fi