Home > Archive > AWK > September 2006 > remote ssh
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| bshah@citadon.com 2006-09-30, 3:56 am |
| Hi Gurus,
I need to get df size information from remote system. I tried follwing
but it gives a syntex error. Can you please help
VARIABLE=`ssh HOST "expr `df -k | grep " /mnt" | awk '{print \$3}'`)"
regards
| |
| Michael Heiming 2006-09-30, 3:56 am |
| In comp.lang.awk bshah@citadon.com:
> Hi Gurus,
> I need to get df size information from remote system. I tried follwing
> but it gives a syntex error. Can you please help
It would be great if you could stop the annoying multi-posting,
cross-post if you think it is needed. I just answered your
question in cus, just to find it again in cla...
Best idea would be to use a real nntp client + server, this
groups.google interface lets most users look like idiots...
[..]
--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvpunry@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 228: That function is not currently supported, but
Bill Gates assures us it will be featured in the next upgrade.
| |
| Bob Harris 2006-09-30, 6:57 pm |
| In article
<1159600367.911904.256590@i3g2000cwc.googlegroups.com>,
bshah@citadon.com wrote:
> Hi Gurus,
> I need to get df size information from remote system. I tried follwing
> but it gives a syntex error. Can you please help
>
> VARIABLE=`ssh HOST "expr `df -k | grep " /mnt" | awk '{print \$3}'`)"
>
> regards
You are getting tripped up by quoted string evaluation between
local and remote.
Try this:
VARIABLE=`ssh HOST df -k | awk '/ \/mnt/ {print $3}'`
I have simplified things, by first just asking the remote system
to do a df, then parse the results on the local system, not the
remote.
In addition, I simplified the evaluation by allowing awk to do the
grep work (more efficient that way and you need far fewer quotes).
Bob Harris
|
|
|
|
|