Re: awk in pure DCL
- From: Wilm Boerhout <w6.boerhout@xxxxxxxxx>
- Date: Mon, 18 May 2009 20:57:16 +0200
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:Works OK on 8.2 too...In article <slrnh0r799.gqm.knatschke@xxxxxxxxxxxxxxxxxxxx>, JKB <knatschke@xxxxxxxxxxxxxx> writes:First added for V8.3; backported to V7.3-2, in an unsupported fashionHow can I cut this line to only keep WE0 ? I can use awk, but isIf 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
there any other way ?
the MAC address using f$getdvi.
$ 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
$ 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
.
- Follow-Ups:
- Re: awk in pure DCL
- From: JKB
- Re: awk in pure DCL
- References:
- awk in pure DCL
- From: JKB
- Re: awk in pure DCL
- From: Bob Koehler
- Re: awk in pure DCL
- From: Rob Brooks
- Re: awk in pure DCL
- From: Jan-Erik Söderholm
- Re: awk in pure DCL
- From: JKB
- awk in pure DCL
- Prev by Date: Re: Tape drive hung
- Next by Date: Re: Tape drive hung
- Previous by thread: Re: awk in pure DCL
- Next by thread: Re: awk in pure DCL
- Index(es):
Relevant Pages
|