#!/bin/sh remove_entry() { local profile="$1" grep -v '^PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/opt/lib/pkgconfig"$' "${profile}" >"${profile}.new" && mv "${profile}.new" "${profile}" } if [ -d "/scratchbox" ] then remove_entry ~/.bash_profile # sigh else remove_entry "/etc/profile.env" fi