I just try to put variable inside variable but it doesn't work... How can i Fix it?
DEL=$(find . -type f | sed "s/^.*\///g" | sed -n '/\./p' | sed "s/.*\.//g" | uniq)
EL=$(${DEL} | tr '\n' ',' | sed 's/,$//')
You can try
EL=$(tr '\n' ',' <<< "$DEL" | sed 's/,$//')
or
EL=$(echo "$DEL" | tr '\n' ',' | sed 's/,$//')
echo "$DEL" but as written (without double quotes), there'd be just one newline in the input to tr, right at the end, and the sed would remove the one comma that tr adds (which is really not very productive).<<< — POSIX shells don't support that). The second works with most shells.
EL=$(echo ${DEL} | tr '\n' ',' | sed 's/,$//')echo ${DEL}prints all elements on a line, that's why tr can't replace'\n'with','. I think you can workout what you need on your own, besides you didn't mention the desired output in your question. :)