From: tester on
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

From: Michael Heiming on
In comp.unix.shell tester <bshah(a)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

> VARIABLE=`ssh HOST "expr `df -k | grep " /mnt" | awk '{print \$3}'`)"

Try something like this:

VAR=`ssh -t HOST "df -k /mnt" | awk 'NR>1{print $3}'`

Good luck

BTW
Please quote context on reply, thx:
http://groups.google.com/support/bin/answer.py?answer=14213

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvpunry(a)urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 108: The air conditioning water supply pipe
ruptured over the machine room
From: tester on
Hi Michael,
Sorry i need expr as well...

VARIABLE=`ssh HOST "expr `df -k | grep " /mnt" | awk '{print \$3}'` -
112000)"


> > VARIABLE=`ssh HOST "expr `df -k | grep " /mnt" | awk '{print \$3}'`)"
>
> Try something like this:
>
> VAR=`ssh -t HOST "df -k /mnt" | awk 'NR>1{print $3}'`
>
> Good luck
>
> BTW
> Please quote context on reply, thx:
> http://groups.google.com/support/bin/answer.py?answer=14213
>
> --
> Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
> mail: echo zvpunry(a)urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
> #bofh excuse 108: The air conditioning water supply pipe
> ruptured over the machine room

From: Michael Heiming on
In comp.unix.shell tester <bshah(a)citadon.com>:
[ top posting fixed ]

>> > VARIABLE=`ssh HOST "expr `df -k | grep " /mnt" | awk '{print \$3}'`)"

>> Try something like this:
>> VAR=`ssh -t HOST "df -k /mnt" | awk 'NR>1{print $3}'`

> Hi Michael,
> Sorry i need expr as well...

> VARIABLE=`ssh HOST "expr `df -k | grep " /mnt" | awk '{print \$3}'` -
> 112000)"

This was example how to go about it. Even if "expr" seems pretty
useless to me here:

VAR=`ssh -t HOST "df -k /mnt" | awk 'NR>1{print $3-112000}'`

It was just meant to show you what to do, not a complete
copy/paste solution.

Good luck

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvpunry(a)urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 93: Feature not yet implemented