Home · Latest · Trends  /  general
0

Conditional shell script

rated 0 times [  0] [ 0]  / comments: 0 / hits: 253  / 10 months ago, mon, mar 13, 2017, 14:27:19
Check if a remote file exists or not as an example
#!/bin/bash

FILE="xxx.xxx.xxx.xxx:/tmp/patched.txt"

if [ -f "$FILE" ];
then
	echo "exists"
else
	echo "does not exist"
fi
More From » general
 

Comments

There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account
 
Share
Sponsor
Posted
rob

rob

Member since Feb 22, 2017
Total Code Snippets: 98
Total Comments: 1
Location: n/a
Following
User not following anyone yet.
rob snippets
10 months ago, wed, feb 22, 2017
10 months ago, wed, feb 22, 2017
10 months ago, wed, feb 22, 2017
10 months ago, wed, feb 22, 2017
10 months ago, wed, feb 22, 2017
10 months ago, wed, feb 22, 2017
10 months ago, wed, feb 22, 2017
10 months ago, wed, feb 22, 2017