remote ssh awk within shell script



Has anyone tried or know a way of running a remote ssh command within a
script that contains an awk statement?

I cant get it to not take $1 as reference from the script.

e.g

Just in a shell this works :-

ssh -l <user> <host> "egrep \"^/\" /etc/novab_backup_location | awk
'{print $1}'"

But when its in a script like this :-

#!/bin/ksh

something=$1 #elswhere in script

con_test()
{
con_test_res=`${SSH} -l <user> $con_server "egrep \"^/\"
$REM_BK_LOC_FILE |awk '{print $1}'" 2>>$con_logfile`
echo Con_test_res is ["$con_test_res"]
}


con_test <server> |read file_list


It takes $1 as a variable which is passed to the script. The script is
much large and has the positional parameters for options used already.

I tried putting \ in front of the $ and all sorts. Perhaps ill have to
use cut or something.


Cheers
_______________________________________________
sunmanagers mailing list
sunmanagers@xxxxxxxxxxxxxxx
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



Relevant Pages

  • Re: create database fatal error
    ... error message. ... In that your script would try to overwrite system01.dbf with a file of ... Thats because I cant read your mind, so I dont know what you need to ... Jorge Corvazar'. ...
    (comp.databases.oracle.server)
  • Re: Internally generated spam - but from where?
    ... I have found the script that is responsible for this *, ... data posted to it so i cant see how they are actually breaking it but I ... How can i track down what is causing ... this single process to use up so much CPU? ...
    (comp.mail.sendmail)
  • .CopyFile to User TEMP - Permission Denied??
    ... I cant copy a file to a users %TEMP% variable using vbscript? ... I am running and testing this script from my local desktop and a full ...
    (microsoft.public.scripting.vbscript)
  • Re: Set Domain Name.
    ... far I have a working script that sets up the network addresses, ... I have looked around on the net and cant find an answer to what I'm ... netsh interface ip set dns "Local Area Connection" static 192.168.1.100 ...
    (microsoft.public.windows.server.scripting)
  • portal rows - row selection quirk
    ... Just came across a weird "quirk" in a db of mine.. ... where I want to select a row and then run a script based on a field in ... try to select row 10 then I cant select it. ... any clarification would be great! ...
    (comp.databases.filemaker)