Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

How to check it on a remote machine?


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
akohan
Asked:
akohan
2 Solutions
 
akohanAuthor Commented:

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
 
slyongCommented:
Hi

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

should work just fine.. may be is the " thing
0
 
TintinCommented:

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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now