Advertisement

05.21.2008 at 08:41AM PDT, ID: 23421296 | Points: 500
[x]
Attachment Details

ssh in shell script

Asked by saibsk in KornShell (ksh)

I am running this command in my shell script

ssh "$machineName" "ls -ltr /export/home/user/clients/$clientDir" >> "$source"_loadDirs.out

But the machine name could be sometime be virtual name and sometimes the real name, If  the machine name is virutal i need to run this command and retrieve the real name "autorep -m". But if it real name I should run the above command. Please advise how can I incoporate this in a script.Start Free Trial
[+][-]05.21.2008 at 11:14AM PDT, ID: 21617544

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 11:57AM PDT, ID: 21617936

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 01:56PM PDT, ID: 21723895

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628