Solved

How to check it on a remote machine?

Posted on 2006-10-25
5
194 Views
Last Modified: 2010-04-20

Hello,

How can I run

                         if [ -e $SOME_PAH ]

on a remote machine as I do on a local?

I tried  ssh  $REMOTE_MACHINE  ls  $SOME_PATH which works fine but I think it is no reliable. Also I tried

fyn = `  ssh $REMOTE_MACHINE [ -e $SOME_PATH] $$ echo y `

but does'nt work!

any comments or advice?

thanks,
0
Comment
Question by:akohan
5 Comments
 

Author Comment

by:akohan
ID: 17807914

It was funny since the second statement now it is working!!!  I had left a space after and after equal sign!

However, does anybody can give me a better way?

Thanks
0
 
LVL 24

Accepted Solution

by:
slyong earned 63 total points
ID: 17808305
Hi

fyn=`ssh $REMOTE_MACHINE "[ -e $SOME_PATH ] && echo y"`

should work just fine.. may be is the " thing
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 62 total points
ID: 17808454

if [ -n "`ssh $REMOTE_MACHINE \"[ -e $SOME_PATH ] && echo y`\"" ]
then
     ....
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question