cp $item > mkdir $map+copy
Ok, so, > redirects the output of a command, the part that's printed (usually to your terminal). E.g. ls outputs a list of files, so ls > list.txt would output that list to list.txt instead. But e.g. cp foo bar explicitly opens the files foo and bar, but doesn't output anything to the terminal.
Thus, the redirection here, gives you an empty file called mkdir, but the rest of the command cp $list $map+copy would copy the file named by $list to whatever $map+copy expands to (the contents of the variable $map and the fixed string +copy, concatenated together).
On the other hand, cat foo would open foo and print it out, and you could use cat foo > bar to direct that printout to a file called bar. Pretty much the same as doing cp foo bar, actually, except that cp has options to like -a and -p to also copy the owner and permission information.
And, in the shell, you can concatenate strings by just sticking them next to each other (without any whitespace in between). So, if you set the variables x=foo y=bar, all of these print foobar:
echo foobar
echo "foo""bar"
echo "$x$y"
echo "foo$y"
echo "${x}bar"
Which means that you can just do "${map}copy" or "$map""copy" to concatenate the two parts.
You do need to run mkdir separately from cp, though, so if $map contains foobar, and $item is hello.txt, this would create a directory foobarcopy, and copy hello.txt to that directory:
mkdir -p "${map}copy"
cp "$item" "${map}copy"
(-p tells mkdir not to error if the directory already exists.)
See:
for issues wrt. (not) double-quoting the variables.
Also, instead of:
list=$( ls )
for item in $list; do
You can have the shell produce a list of filenames without calling ls:
for item in ./*; do
See: