Answer the question
In order to leave comments, you need to log in
How to do substitution in bash?
There are two text files that contain let.
Содержимое первого
/test1/file 1.txt
/test1/file 2.txt
/test1/file 3.txt
Содержимое второго
/test2/papka 1
/test2/papka 2
/test2/papka 3
#!/bin/bash
a=$(cat text01.txt)
b=$(cat text02.txt)
VAR=$(paste -d " " <(echo "$a") <(echo "$b"))
echo "$VAR"
Получается
/test1/file 1.txt /test2/papka 1
/test1/file 2.txt /test2/papka 2
/test1/file 3.txt /test2/papka 3
Answer the question
In order to leave comments, you need to log in
Are you sure there are spaces in the filenames?
If not, then you can do this:
or this
sed "s/.*/mv /" 1.txt >text03.txt
paste text03.txt text02.txt text01.txt
sed -i "s/ /\\\ /g" text01.txt text02.txt
paste 1.txt 2.txt|xargs -n2 mv
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question