Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
複数行のファイルを含むファイルがあります。また、すべてのファイルがあるディレクトリもあります。ファイルにリストされているファイルがディレクトリに存在するか、シェルスクリプトを介して存在しないかを見つけたいと思います。
繰り返してテストする
cat filelist.lst | while read filename do if [ -f directory/$filename ] then echo File $filename exists # build up a list exists="$exists directory/$filename" fi done