User Tools

Site Tools


bash:test_file_existence

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
bash:test_file_existence [2019/12/17 19:14] – created peterbash:test_file_existence [2021/01/26 12:33] (current) – removed peter
Line 1: Line 1:
-====== BASH - Test File Existence ====== 
  
-<code bash> 
-#!/bin/bash 
-filename=$1 
-if [ -f "$filename" ]; then 
-echo "File exists" 
-else 
-echo "File does not exist" 
-fi 
-</code> 
bash/test_file_existence.1576610082.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki