Re: file script and cmd script difference

2006-06-29 Thread John W. Krahn
joseph wrote: > Hi list, Hello, > I'd like to ask explaination/help regarding this: > > 1)perl -e '%hash; for (`arp`) {($addr,$mac) = (split(/\s+/))[0,2]; > $hash{$addr}= $mac } foreach (keys %hash) { print "\t $_ => $hash{$_}\n";}' Could be written more simply as: arp | perl -lane'print "\t

Re: file script and cmd script difference (close)

2006-06-29 Thread joseph
""Jeff Peng"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > >> my($addr,$mac) = (split(/s+/))[0,2]; > > You maybe would check your scripts carefully at first. > Here should be: > my($addr,$mac) = (split(/\s+/))[0,2]; > > You have lost the '\' before 's+' in your regex. >

RE: file script and cmd script difference

2006-06-29 Thread Jeff Peng
my($addr,$mac) = (split(/s+/))[0,2]; You maybe would check your scripts carefully at first. Here should be: my($addr,$mac) = (split(/\s+/))[0,2]; You have lost the '\' before 's+' in your regex. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL P