#!/usr/bin/perl exec "cd somedir; $ENV{SHELL}"; # Substitute if not set by your shell