Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to execute the following script to find a path of directory on remote path I'm new to scripting and unable to understand as to where I am going wrong Can someone please help me to correct it?

!/bin/sh
ssh ssmis "echo Hello I am Logged in  `hostname` and getting ready to transfer and convert your files ;source .bash_profile;array=(asd-005-cpu eims-asd-005-apcpu);
for item in ${array[*a]};
do
echo $item;
path2=find /nnn/n4/db4/health -type f "${item}" -print;
echo $path2;
done;"
share|improve this question
    
the first 2 characters of the first line must be #! – glenn jackman Apr 30 '12 at 2:11
    
What exactly is going wrong? please post any/all errors you are receiving or state exactly what is happening that differs from your expectations. – MaQleod Apr 30 '12 at 2:18
    
There is more or less not a single working line in that entire script. Have you pasted it incorrectly? Have you written it yourself? – Daniel Andersson Apr 30 '12 at 7:44

Change the outermost double quotes to single quotes, otherwise your current shell will interpret and replace what you are sending to the remote server. Better still write a script in remote and execute that script remotely to avoid quoting issues.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .