bash - Linux - concatenate every line of a text file with an argument passed into a function -



bash - Linux - concatenate every line of a text file with an argument passed into a function -

i have .sh function accepts path argument $1. have text file file names. need concatenate value of $1 every line of text file

txt file: file1.jpg file2.jpg argument: $1 = path/ $2 = to/dir/

goal

txt file: path/to/dir/file1.jpg path/to/dir/file2.jpg

still assuming lines in file contain only partial path info , extending thought in comment get:

sed -e "s!^!$1/$2/!" file

linux bash concatenation

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -