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

c - Compilation of a code: unkown type name string -

ubuntu - Bash Script to Check That Files Are Being Created -

Php operator `break` doesn't stop while -