2017-11-16 9 views
0

私はzipにいくつかのファイルを1つのアーカイブにしようとしています。私の作業ディレクトリ内 などがあり2.txtませんが、何の1.txt存在しないファイルを圧縮しようとするとzipコマンドラインを終了する方法

$ zip -r 1.zip 1.txt 2.txt 
zip warning: name not matched: 1.txt 
adding: 2.txt (stored 0%) 
$ echo $? 
0 

私がいずれかのファイルが存在しない場合は終了しzipを強制するためにどのような方法がありますが、代わりにそれは現在ありませんのような単なる警告を印刷します?

事前にどうもありがとうzip(1)のmanページから

答えて

1

-MM 
    --must-match 
      All input patterns must match at least one file and all input 
      files found must be readable. 
関連する問題