Home · Latest · Trends  /  general
0

Conditional shell script

rated 0 times [  0] [ 0]  / comments: 1 / hits: 623  / 2 yaers 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

0
I did need the help as much. But I was astounded by the solution for shell script which was also similar to the one at https://www.australian-writings.net/ and this hopefully will be helpful for others. So be sure to check them all out.
[#154] Friday, July 19, 2019, 10:59:37
 
stephaniesteph86
commented 1 month ago
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: 127
Total Comments: 1
Location: n/a
Following
User not following anyone yet.
rob snippets
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017