I have a file "selected_files.log" containing paths (a couple thousand lines) and I have a exclusion file "exclusion.txt" containing path and extensions I don't want to see in my selected_files.log
I have been trying with grep and sed, with no luck this is my last search. anybody help? thanks
lines=$(cat exclusion.txt)
for x in "$lines";
do
grep -v "$x" "selected_files.log" > new_file.log
echo "x is $x"
#sed `/$x/d` -i "selected_files.log"
done
Comm -23 doesn't work because files aren't sorted. I've tried with "/"$x"/d" -i but no luck : unterminated address regex
exemples of what my files contain selected_files.log
/mnt/user/system/data/S97/001584.bkp
/mnt/user/system/data/S97/00284.bkp
/mnt/user/system/data/S97/0058244.bkp
/mnt/user/system/data/A12/external.log
/mnt/user/system/data/A12/internal.log
/mnt/user/system/input/system_run.sh
/mnt/user/system/input/user.sh
/mnt/user/system/output/results.dt
/mnt/user/david/test/test.sh
/mnt/user/david/prod/bdd.bkp
/mnt/user/system/old_bkp.tmp
/mnt/user/system/output/test space/test.tmp
exclusion.txt
external.log
/mnt/user/system/input/
david
.tmp
result wanted:
/mnt/user/system/data/S97/001584.bkp
/mnt/user/system/data/S97/00284.bkp
/mnt/user/system/data/S97/0058244.bkp
/mnt/user/system/data/A12/internal.log
/mnt/user/system/output/results.dt