A new need arose accompanied by a good new question that until then I did not find anything similar on the internet - Copy a single line at a time, for a single different file .
Example for each new line to be copied:
total=10
linha='cat Arquivo_de_origem'
for i in 'seq $total'
echo "$linha" > /home/$USER/$i
done
The source file contains more than 10 lines, but I just need to get ten, so I give the limit on the variable total=10
This will cause for
to go 10x determined by seq
, interacting with i
The echo
followed by the variable linha
establish line-by-line