This is the answer I came up with in the end
#!/bin/bash
>oldFiles.txt
files=$(grep ' jane ' ../data/list.txt | cut -d ' ' -f 3)
for x in $files;
do
if test -e ../data/$x; then echo $x >> oldFiles.txt; else echo $x; fi;
done
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.