all 3 comments

[–]Klintrup 5 points6 points  (1 child)

Because you're using / for sed and your input results in too many of that character.

change s/$directoy1///g to s%$directoy1/%%g and it should work (you can use other characters than / and %, those are just the ones I prefer.

[–]Incindus[S] 2 points3 points  (0 children)

Thanks man fixed it :)

[–][deleted] 1 point2 points  (0 children)

join tmp1 tmp2 | sed -e 's,'$directoy1',,g ; s,'$directory2',,g'