use "cat --" to skip options
escape slash in sed pattern
use -f flags
suppress basename/dirname error