SED to append a string to each line of a file

cp test* /home/mydirectory/files

sed "s/$/|`head -1 test.dat.20080917233024`/g" test.dat.20080917233024 > new_test.dat.20080917233024

sed '1d;$d' new_test.dat.20080918233023 > test.dat.20080918233023

No comments: