|
|||||||||
| Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here. |
learn unix and linux commands |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
check if file exists on remote system ?
Hi there, I am designing a software rollout script and need to check if a particular file exists on a remote system something along the lines of Code:
if [ -f `ssh remote_box /opt/SUNWexplo/bin/explorer` ] ; then blah blah The above doesnt work but you get the general idea....is there a way I can do this on a single line ?? any help would be greatly appreciated |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Code:
if [ -n "`ssh $REMOTE 'ls /opt/SUNWexplo/bin/explorer'`" ]; then blah; blah; blah; fi 2>/dev/null Carl |
| Sponsored Links | ||
|
|
|
#3
|
||||
|
||||
|
perfect thank you
|
| Sponsored Links | ||
|
|
![]() |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| csh Check if file exists on remote system | meteorologistks | Shell Programming and Scripting | 3 | 10-07-2011 12:40 PM |
| Check file exists on remote machine. | marpadga18 | Shell Programming and Scripting | 2 | 10-24-2010 03:41 PM |
| ftp - check if file on remote exists (skip overriding) | spiriad | UNIX for Dummies Questions & Answers | 3 | 07-30-2010 06:25 AM |
| Check EOF char in Unix. OR To check file has been received completely from a remote system | alexalex1 | UNIX for Advanced & Expert Users | 5 | 07-22-2010 08:48 PM |
| check if remote file exists | hcclnoodles | Shell Programming and Scripting | 2 | 08-27-2008 06:53 PM |
|
|