From 3b0324f9369f344030b44f5c7330d36d01ab2540 Mon Sep 17 00:00:00 2001 From: Jan Pazdziora Date: Mon, 28 May 2018 12:05:12 +0200 Subject: [PATCH] =?UTF-8?q?Address=20rm:=20cannot=20remove=20=E2=80=98*.xm?= =?UTF-8?q?l=E2=80=99=20and=20=E2=80=98*.gz=E2=80=99:=20No=20such=20file?= =?UTF-8?q?=20or=20directory.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upon the first execution, there is no .xml to remove. After the loop finishes, all downloaded .xml.gz files should have been already gunzipped. Using rm -f avoids the "No such file or directory" noise. --- download_xml.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/download_xml.sh b/download_xml.sh index 8d7b713..50f2e56 100755 --- a/download_xml.sh +++ b/download_xml.sh @@ -2,7 +2,7 @@ mkdir -p dbs cd dbs -rm *.xml +rm -f *.xml year=`date +"%Y"` for i in $(seq -f "%04g" 2002 $year) @@ -11,4 +11,4 @@ do gunzip nvdcve-$i.xml.gz done -rm *.gz +rm -f *.gz