#!/bin/bash # really, a demo that environment variables are copied # to child shells, but if you change that copy, # it only changes that copy, it doesn't change the # original in the spawning shell # (ls dies below, but ls will still work afterwards # in the calling shell) echo "inside harmless-to-call" echo "BEFORE muck with PATH: $PATH" PATH=. echo "still inside: \$PATH: $PATH" ls # this should DIE