* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [070401 20:41]:
> On my system the default route has both an explicit metric and a realm,
> so it looks like this:
> 
> default via 10.0.0.138 dev br0  metric 1 realm 10
> 
> Since the output of 'ip route ls' does not have a fixed format I suggest
> to use the following awk program:
> 
> switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if ($(i) == 
> "dev") print $(i+1) }}')
> 
> which matches the default route and prints the field following the 'dev'
> token (which is always the interface name).

Thanks for the bug report and the fix!

I'll put that in my repository and hope to upload another version with
some other bug fixes, I'll also forward this to upstream from where this
script came originally.

Baruch


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to