On 11/24/21 15:03, Bernhard Voelker wrote:
Sure, the attached is an approach with shell tools

Can't this be done without using any subsidiary commands?

Something like the following untested code. This removes all relative names from PATH, not just '.'.

saved_IFS=$IFS
IFS=:
new_PATH=
for dir in $PATH; do
  case $dir in
    /*) new_PATH=$new_PATH${new_PATH:-:}$dir;;
  esac
done
IFS=$saved_IFS
PATH=$new_PATH

Reply via email to