remote ssh awk within shell script
- From: Dave Markham <dave.markham@xxxxxxxxxx>
- Date: Thu, 08 Feb 2007 11:38:43 +0000
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
- Prev by Date: Hi
- Next by Date: SUMMARY: "frequent" crashes without a trace
- Previous by thread: Hi
- Next by thread: SUMMARY: "frequent" crashes without a trace
- Index(es):
Relevant Pages
|