#!/bin/bash # echo command and execute for logging PWD=$(pwd) PWD=${PWD##*/} echo "[${PWD}] \$ $*" eval "$*" exit $?