#!/bin/sh echo "This is shell" SPECIAL_VAR=1 export SPECIAL_VAR eval "exec perl -x -S $(dirname $0)/$(basename $0) ${1+\"\$@\"}" #! -*- perl -*- -w use strict; print "This is Perl\n"; print "ARGV:".join(':',@ARGV)."\n"; print "SPECIAL_VAR: $ENV{SPECIAL_VAR}\n"; #### sample -multi "hello there" -single one