The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 10-14-2008
Helmut Helmut is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 10
ok - the problem is that i have to copy my file to the remote destination!

how can i execute the following command on my remote host?

this command is correct:

nawk '{system("/opt/EMCpower/bin/emcpadm renamepseudo -f d -s "$1" -t "$2)}' filename

but how can i do this remote? my problem is that after ssh $1 I canīt make "(....)" because there are " in my command! so any ideas?

scp ${filestart}$1${fileend} $1:${destdir}
ssh $1 (cd ${destdir} && nawk '{system("/opt/EMCpower/bin/emcpadm renamepseudo -f d -s "$1" -t "$2)}' ${filestart}$1${fileend} && rm ${filestart}$1${fileend})

the solution is to give the nawk command in a file, copy this file to the remote server and execute it there!

Last edited by Helmut; 10-14-2008 at 10:27 AM..