?
Solved

How to check it on a remote machine?

Posted on 2006-10-25
5
Medium Priority
?
199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 252 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 248 total points
ID: 17808454

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month11 days, 11 hours left to enroll

752 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