2 improved formatting to get double backslash visible
source | link

Use single quotequotes with double back slash, and you will not get any error.

touch ~/deleted/$(echo "directory_"$(readlink -f foo)|tr '/' '\')

touch ~/deleted/$(echo "directory_"$(readlink -f foo)|tr '/' '\\')

Use single quote with double back slash you will not get any error.

touch ~/deleted/$(echo "directory_"$(readlink -f foo)|tr '/' '\')

Use single quotes with double back slash, and you will not get any error.

touch ~/deleted/$(echo "directory_"$(readlink -f foo)|tr '/' '\\')
1
source | link

Use single quote with double back slash you will not get any error.

touch ~/deleted/$(echo "directory_"$(readlink -f foo)|tr '/' '\')