I have a multiple values stored in a variable (directory names). To view values I put them into a lst file.
for i in ' */ ' ; do
echo $i > list.lst
done
###Turn row into column
fmt -1 list.lst > listColumns.lst
sed 's:/::g' listColumns.lst > predicted.lst
for data in $(cat predicted.lst) ; do
predicted=$data
#echo $predicted
done
###Get names of targets and assign to variable $targets
for names in $(cat targets.lst) ; do
targets=$names
#echo $targets
done
###Remove contents of $predicted from $targets and put into new list
grep -v "${predicted}" "${targets}" > targets2.lst
For the last part of actually removing $predicted from $targets I also tried using sed but with no luck.
Thanks for any help.