Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

shell script remove file if exists

#!/bin/bash

file="file_you_want_to_delete"

if [ -f "$file" ] ; then
    rm "$file"
fi
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #shell #script #remove #file #exists
ADD COMMENT
Topic
Name
7+3 =