Re: awk in pure DCL



JKB vaguely mentioned on 18-5-2009 16:16:
Le 15-05-2009, ? propos de
Re: awk in pure DCL,
Jan-Erik Söderholm ?crivait dans comp.os.vms :
Rob Brooks wrote:
koehler@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (Bob Koehler) writes:
In article <slrnh0r799.gqm.knatschke@xxxxxxxxxxxxxxxxxxxx>, JKB <knatschke@xxxxxxxxxxxxxx> writes:
How can I cut this line to only keep WE0 ? I can use awk, but is
there any other way ?
If you really want the MAC address of your NIC from a DCL script, you probably should search for your NIC using f$device and fetch
the MAC address using f$getdvi.
First added for V8.3; backported to V7.3-2, in an unsupported fashion

$ write sys$output f$getdvi( "ewa0", "lan_mac_address" )
AA-00-04-00-0C-2C
$ write sys$output f$getdvi( "ewa0", "lan_default_mac_address" )
08-00-2B-86-AD-95

Works OK on 8.2 too...

$ write sys$output f$getdvi( "ewa0", "lan_mac_address" )
08-00-2B-87-35-E2
$ write sys$output f$getdvi( "ewa0", "lan_default_mac_address" )
08-00-2B-87-35-E2
$

Thanks for all explanations, but I think that I think that I misunderstand
something...

$ address = p1
$ pipe tcpip show interfaces -
| search sys$input "''address'" -
| ( read sys$pipe line ; -
write sys$output f$element(0, " ", f$edit(line, "compress, trim")) ) -
| ( read sys$pipe line ; -
write sys$output f$getdvi(line, "lan_mac_address") )
$ exit

When I try to execute this script, I obtain :
$ @com 192.168.0.86
%SYSTEM-W-NOSUCHDEV, no such device available
\WE0\
$

I have tried to replace 'line' by a logical name (def/job) without any
success. I suppose I have made a mistake.

Yes, but an obscure one. Correct syntax, wrong semantics.

It's all because the output of "tcpip show interface" reports the interface name on the line in "tcp format" (we0), and f$getdvi expects it in "VMS format" (EWA0).

I'm not sure how to solve this. f$getdvi may have a method to enumerate network devices in VMS format, but then you still would have to find out which interface(s) run tcpip.

Simple text substitution (transforming we0 --> EWA0) works for some devices, but not for all surely.

Greater minds than mine must work on this...

/Wilm
.



Relevant Pages

  • Re: awk in pure DCL
    ... Re: awk in pure DCL, ... If you really want the MAC address of your NIC from a DCL script, ... It's all because the output of "tcpip show interface" reports the ...
    (comp.os.vms)
  • Re: Logic Fachsimpeleien
    ... VST vermeide ich am Mac, ... Die nehme ich dann mit dem iBook ... Heisst ja nicht, dass ein Rechner innerhalb von 3a sofort kaputt gehen ... Zugangsberechtigungen und simplem POST Interface auf einem Server ...
    (de.comp.sys.mac.misc)
  • Re: the new interface
    ... If you are going to use the Mac version of RB ... If you used a Mac for years then you'd know the new interface does not ... one window interfaces are WHY I don't use Windows products (lets see here, ... actually a Mac user as he/she claims. ...
    (comp.lang.basic.realbasic)
  • Re: ng_one2many v.s. AFT (NIC Fault Tolerance/Fail Over/Redundancy Revisited)
    ... > hosts weren't seeing the usual warnings about MAC address changes. ... regardless of what network segment/port a host ... > physical interface ifconfig'd with the IP. ... > tree root and switch 1 is the backup spanning tree root. ...
    (freebsd-questions)
  • Re: kern/109815: wrong interface identifier at pfil_hooks for vlans + if_bridge
    ... +on the interface with the MAC address equal to the packet's destination ... the filter for processing. ... +table according to the packet destination address (not the MAC ...
    (freebsd-net)