#!/bin/bash
NUM=$1
VAR_NAME="dir${NUM}"
echo "cd ${!VAR_NAME}"
cd "${!VAR_NAME}"