Hi there,

I am trying to use ssh to do some file mainpulation on a remote host.

Consider bash script.

if [ ! ` ssh $user@$host ls /host/home/user/tmp/bin/$dir_name ` ]; then 
     echo -e " \\t Hm! $dir_name is not there, creat $dir_name"
      etc ...
fi

this is working OK.

but if I say

if [ ! ` ssh $user@$host ls -ls /host/home/user/tmp/bin/$dir_name ` ];

# NOTE ls -al option

                etc...
fi

it does not work error message: ./test: [: too many arguments

Q1. Could you tell me why?
Q2  Any suggestion to make it working.

Thank you in advance.

Ivan.

-- 
================================================================================

Ivan Teliatnikov,
F05 David Edgeworth Building,
Department of Geology and Geophysics,
School of Geosciences,
University of Sydney, 2006
Australia

e-mail: [EMAIL PROTECTED]
ph:  061-2-9351-2031 (w)
fax: 061-2-9351-0184 (w)

===============================================================================

Reply via email to