#!/bin/bash extra_path="" while [ ! -d .lib ]; do extra_path=$(basename $(pwd))"/$extra_path" cd .. [ $(pwd) == / ] && exit 1 done export extra_path { echo "BEGIN { require '.lib/Init.pl'; }" if [ "$1" != "Init.pl" ]; then if [ "$1" != "Devel.pl" ]; then # Devel.pl loaded from Init.pl echo "#line 1 $extra_path$1" cat $extra_path$1 fi fi } | /usr/share/vim/vim*/tools/efm_perl.pl -c - | perl -pe ' s!\Q$ENV{extra_path}\E!!g; '