The task is to copy a file from several sub-directories that are numbered from n=1:10 (e.g. /dir_4/file.txt) to the main directory under a different name (e.g. file_4.txt) as follows:
for n=1:10
cp /dir_n/file.txt file_n.txt
end
How to write and execute this script in Linux?
In bash, this should do it.