#!/bin/bash i=1 testdir="`pwd`/foo" (rm -rf "$testdir"; rm -rf "$testdir") &>/dev/null mkdir -p "$testdir" for x in $(cat list) do temp="$testdir/${x/3pm/tmp}" x="$testdir/${x}" touch "$temp" ln "$temp" "$x" rm -f "$temp" # echo "Pass $i" # i=$((i+1)) done