Re: UNIX : script help/input

2003-10-02 Thread Jared . Still

I would be tempted to use Java for this rather than C.

Much more portable than external procedures, an important distinction
in a heterogenous shop.

Jared







Vladimir Begun <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
 10/02/2003 12:34 PM
 Please respond to ORACLE-L

        
        To:        Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
        cc:        
        Subject:        Re: UNIX : script help/input


Jamadagni, Rajendra wrote:
> unfortunately we _had_ to do it in pl/sql ... it is part of the 
> encrypted feed that we send out to our clients ... it is decoded by a chip.
>  
> Oh well  I am back to array of references ...

I'd suggest to consider external C function -- it's faster, it's
easier to write especially when you need to work with bits, shifts
etc.. I've recently implemented crc32 for some internal project --
works well, obviously faster than SQL, PL/SQL and native comp of
PL/SQL code. Native comp. is also good to consider, if it's 9i.
Sure, it depends...
-- 
Vladimir Begun
The statements and opinions expressed here are my own and
do not necessarily represent those of Oracle Corporation.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Vladimir Begun
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




Re: UNIX : script help/input

2003-10-02 Thread Jared . Still

This database is 8i.

I would probably still use the package, as it does octal, hex and binary
as well as base 36 and 64.  

Jared








Vladimir Begun <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
 10/02/2003 12:24 PM
 Please respond to ORACLE-L

        
        To:        Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
        cc:        
        Subject:        Re: UNIX : script help/input


[EMAIL PROTECTED] wrote:
> Left pad with zeroes, take a substring, feed it to the handy-dandy
> hex/oct/bin/dec converter package - much easier.

Jared, what Oracle edition do you use? I'm asking because you might
want to consider not to use 'handy-dandy' hex/oct/bin/dec converter
package, but TO_CHAR/TO_NUMBER in case it's >= 8i -- it would work
faster.

SELECT TO_NUMBER(SUBSTR('0x50AA', -6), 'FM0X') dec
      , '0x' || TO_CHAR(170, 'FM0X') hex
   FROM dual
/
-- 
Vladimir Begun
The statements and opinions expressed here are my own and
do not necessarily represent those of Oracle Corporation.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Vladimir Begun
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




RE: UNIX : script help/input

2003-10-02 Thread Jamadagni, Rajendra
Title: RE: UNIX : script help/input






it was actually "C" code ... but because data is going on a modem, the pl/sql speed is acceptable (in fact we have to _wait_ after sending out each message). Had fun doing that though ... it is critical, tied to our SLA ... so must be up all the time. I'd rather handle exceptions in pl/sql than in "C".

Raj


-Original Message-
From: Vladimir Begun [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 02, 2003 3:35 PM
To: Multiple recipients of list ORACLE-L
Subject: Re: UNIX : script help/input



Jamadagni, Rajendra wrote:
> unfortunately we _had_ to do it in pl/sql ... it is part of the 
> encrypted feed that we send out to our clients ... it is decoded by a chip.
>  
> Oh well  I am back to array of references ...


I'd suggest to consider external C function -- it's faster, it's
easier to write especially when you need to work with bits, shifts
etc.. I've recently implemented crc32 for some internal project --
works well, obviously faster than SQL, PL/SQL and native comp of
PL/SQL code. Native comp. is also good to consider, if it's 9i.
Sure, it depends...
-- 
Vladimir Begun
The statements and opinions expressed here are my own and
do not necessarily represent those of Oracle Corporation.


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Vladimir Begun
  INET: [EMAIL PROTECTED]


Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California    -- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



This e-mail 
message is confidential, intended only for the named recipient(s) above and may 
contain information that is privileged, attorney work product or exempt from 
disclosure under applicable law. If you have received this message in error, or are 
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 
and delete this e-mail message from your computer, Thank 
you.*2


Re: UNIX : script help/input

2003-10-02 Thread Vladimir Begun
Jamadagni, Rajendra wrote:
unfortunately we _had_ to do it in pl/sql ... it is part of the 
encrypted feed that we send out to our clients ... it is decoded by a chip.
 
Oh well  I am back to array of references ...
I'd suggest to consider external C function -- it's faster, it's
easier to write especially when you need to work with bits, shifts
etc.. I've recently implemented crc32 for some internal project --
works well, obviously faster than SQL, PL/SQL and native comp of
PL/SQL code. Native comp. is also good to consider, if it's 9i.
Sure, it depends...
--
Vladimir Begun
The statements and opinions expressed here are my own and
do not necessarily represent those of Oracle Corporation.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Vladimir Begun
 INET: [EMAIL PROTECTED]
Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Re: UNIX : script help/input

2003-10-02 Thread Vladimir Begun
[EMAIL PROTECTED] wrote:
Left pad with zeroes, take a substring, feed it to the handy-dandy
hex/oct/bin/dec converter package - much easier.
Jared, what Oracle edition do you use? I'm asking because you might
want to consider not to use 'handy-dandy' hex/oct/bin/dec converter
package, but TO_CHAR/TO_NUMBER in case it's >= 8i -- it would work
faster.
SELECT TO_NUMBER(SUBSTR('0x50AA', -6), 'FM0X') dec
 , '0x' || TO_CHAR(170, 'FM0X') hex
  FROM dual
/
--
Vladimir Begun
The statements and opinions expressed here are my own and
do not necessarily represent those of Oracle Corporation.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Vladimir Begun
 INET: [EMAIL PROTECTED]
Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


RE: UNIX : script help/input

2003-10-02 Thread Jamadagni, Rajendra



unfortunately we _had_ to do it in pl/sql ... it is part of the encrypted 
feed that we send out to our clients ... it is decoded by a 
chip.
 
Oh 
well  I am back to array of references ...
 
Raj

  -Original Message-From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]Sent: Thursday, October 02, 2003 
  2:20 PMTo: Multiple recipients of list ORACLE-LSubject: 
  RE: UNIX : script help/inputRaj, I did consider doing 
  it this way, but the thought of writing stuff to the bit level for a prototype was just too painful. 
  Left pad with zeroes, take a substring, 
  feed it to the handy-dandy hex/oct/bin/dec converter package - much easier. Jared 
  


  
  "Jamadagni, Rajendra" 
<[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 
 10/02/2003 05:54 AM 
 Please respond to ORACLE-L 
                  To:     
   Multiple recipients of list ORACLE-L 
<[EMAIL PROTECTED]>         cc:       
        
  Subject:        RE: UNIX : script 
help/inputXOR  that gives me some painful memories in recent days ... xor is 
  possible in pl/sql but needs a little work. I migrated a "C" encryption code 
  to pl/sql  and then use utl_tcp to sent it to our router which feeds the 
  modem banks. 
  This is how I worked on it ... but I 
  was working on character by character ... 
  xor(a,b) is r_a := utl_raw.cast_to_raw(chr(a)); r_b := utl_raw.cast_to_raw(chr(b)); n_xor := to_number(utl_raw.bit_xor(r_a,r_b),''); 
  
  Of course the manual doesn't tell you 
  this ... 
  Raj  Rajendra dot Jamadagni at nospamespn dot com All Views expressed in this email are strictly 
  personal. QOTD: Any clod can have facts, having an 
  opinion is an art ! 
  
  -Original Message- Sent: Wednesday, October 01, 2003 6:29 PM To: Multiple recipients of list ORACLE-L 
  
  > Good! The more the merrier! 
  Welcome to the club. 
  Oh most definitely. 
  As I just finished writing a prototype 
  package for assigning MAC 
  addresses ( we make network 
  stuff - that's a technical term ), I have endured the 
  agonies of doing hex math in PL/SQL. 
  I finally bit the bullet and used 
  string manipulation to convert 
  hex to decimal and do what I 
  needed that way.  Couldn't get BITAND to work properly on 
  very large integers. Besides, doing XOR with BITAND in PL/SQL is very painful. 
  UTL_RAW has an XOR, but it requires RAW 
  values and I didn't feel 
  like messing with 
  it. 
  This is all very simple in 
  Perl. 
  Given a MAC of 5AA, with a 
  fixed portion of 500, 
  it is very easy to determine 
  the variable portion of the address 
  via $x = 0x5AA ^ 
  500. 
  Not quite so simple in 
  PL/SQL. 
  Jared 
  
  


RE: UNIX : script help/input

2003-10-02 Thread Jared . Still

Raj,

I did consider doing it this way, but the thought of writing stuff to the
bit level for a prototype was just too painful.

Left pad with zeroes, take a substring, feed it to the handy-dandy
hex/oct/bin/dec converter package - much easier.

Jared








"Jamadagni, Rajendra" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
 10/02/2003 05:54 AM
 Please respond to ORACLE-L

        
        To:        Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
        cc:        
        Subject:        RE: UNIX : script help/input


XOR  that gives me some painful memories in recent days ... xor is possible in pl/sql but needs a little work. I migrated a "C" encryption code to pl/sql  and then use utl_tcp to sent it to our router which feeds the modem banks.
This is how I worked on it ... but I was working on character by character ... 
xor(a,b) is 
r_a := utl_raw.cast_to_raw(chr(a)); 
r_b := utl_raw.cast_to_raw(chr(b)); 
n_xor := to_number(utl_raw.bit_xor(r_a,r_b),''); 

Of course the manual doesn't tell you this ... 
Raj 
 
Rajendra dot Jamadagni at nospamespn dot com 
All Views expressed in this email are strictly personal. 
QOTD: Any clod can have facts, having an opinion is an art ! 

-Original Message- 
Sent: Wednesday, October 01, 2003 6:29 PM 
To: Multiple recipients of list ORACLE-L 

> Good! The more the merrier! Welcome to the club. 
Oh most definitely. 
As I just finished writing a prototype package for assigning MAC 
addresses ( we make network stuff - that's a technical term ), I 
have endured the agonies of doing hex math in PL/SQL. 
I finally bit the bullet and used string manipulation to convert 
hex to decimal and do what I needed that way.  Couldn't get BITAND 
to work properly on very large integers. Besides, doing XOR with 
BITAND in PL/SQL is very painful. 
UTL_RAW has an XOR, but it requires RAW values and I didn't feel 
like messing with it. 
This is all very simple in Perl. 
Given a MAC of 5AA, with a fixed portion of 500, 
it is very easy to determine the variable portion of the address 
via $x = 0x5AA ^ 500. 
Not quite so simple in PL/SQL. 
Jared 



Re: UNIX : script help/input

2003-10-02 Thread Don Yu
Johan:

Please see the attachment file, which is my script for everyday web
server log file and uses nslookup to process the results. Hope that it
is helpful.

Don


Johan Muller wrote:

> Anybody with a quick and dirty (elegant would be nice too), to munge
> output from a nslookup output file to a delimited file?
>
> 'File content:
>
> Server:  dns1.mci.com
> Address:  199.249.19.1
>
> Name:WCOM-4NXZGAPWY5.mcilink.com
> Address:  166.50.73.209
>
> Delimited file should have the following line(s);  (using | or
> whatever as delimiter):
>
> '166.50.73.209'|'4NXZGAPWY5.mcilink.com'.
>
> Required for both single and multiple records.
>
>
>
> TIA
#! /bin/ksh
# file name: log_file_parsing
# Date: March 6,2003; Mar 7,2003; Mar 10,2003; Mar 13,2003; May 7,2003; 12 May,2003; 
May 15,2003; 
#   May 20,2003; May 30,2003
#
# Author: Don Y.
# Desc: an example of parsing netTracker related web access from web server 
(www.welch.jhu.edu) access 
#   log file. Extract client IP, access date, and host IP. This script also 
transfer client IP
#   with alphabet  into digital one by issuing nslookup command call. Finally make 
nslookup work
#   for it outputs a few lines instead of one line.  
#

# define output file
WORKING_DIR=$1
OUTPUT_FILE="$WORKING_DIR/log_file_parsing_output.temp"
INPUT_FILE=$WORKING_DIR/$2
TEMP_NAME=$3
SCRIPT_HOME="/export/users/dony/report"

# check input access log file exists or not under $WORKING_DIR
if [ ! -f $WORKING_DIR/$2 ]
then
echo "input access log file doesn't exist at working directory!"
exit 1
fi

# check output file under working directory exist or not : 
$WORKING_DIR/log_file_parsing_output.temp
if [ ! -f $WORKING_DIR/log_file_parsing_output.temp ]
then
touch $WORKING_DIR/log_file_parsing_output.temp
chown dony:staff $WORKING_DIR/log_file_parsing_output.temp
fi

# check all temporary files exist or not
if [ -f $WORKING_DIR/log_file_parsing_temp01.temp ]
then
rm $WORKING_DIR/log_file_parsing_temp01.temp
else
# create an empty file with owner status: dony:staff
touch $WORKING_DIR/log_file_parsing_temp01.temp
chown dony:staff $WORKING_DIR/log_file_parsing_temp01.temp
fi

if [ -f $WORKING_DIR/log_file_parsing_temp02.temp ]
then
rm $WORKING_DIR/log_file_parsing_temp02.temp
else
touch $WORKING_DIR/log_file_parsing_temp02.temp
chown dony:staff $WORKING_DIR/log_file_parsing_temp02.temp
fi

# file parsing for NetTracker associated lines
success=0
cat $INPUT_FILE | grep "/cgi-bin/ntlinktrack.cgi" | awk '{print 
$1,substr($4,2,11),$7}' | sed 's/\/cgi-bin\/ntlinktrack.cgi?//' > 
$WORKING_DIR/log_file_parsing_temp01.temp
let success=success+$?
sed 's/http:\/\/www.welch.jhu.edu\/cgi-bin\/ntlinktrack.cgi?//' 
$WORKING_DIR/log_file_parsing_temp01.temp > $WORKING_DIR/log_file_parsing_temp02.temp
let success=success+$?

# get start line number here
whole_parsing_start_line=`cat $OUTPUT_FILE | wc -l`

# change the date format
for arg_each_line in `cat $WORKING_DIR/log_file_parsing_temp02.temp | awk '{ print 
$1"==="$2"==="$3 }'`
do
one_line=`echo $arg_each_line | sed 's/===/ /g'`
# debug one line below if enabled
#echo $one_line >> $WORKING_DIR/log_file_parsing_temp03.temp
client_ip=`echo $one_line | awk '{ print $1 }' | sed 's/ //g'`
org_date=`echo $one_line | awk '{ print $2 }' | sed 's/ //g'`
oracle_date=`$SCRIPT_HOME/ldate $org_date`
host_ip=`echo $one_line | awk '{ print $3 }' | sed 's/ //g'`
# transfer client_ip from alphabet to digital
client_addr=`echo "$client_ip" | egrep -i -e [a-z] | sed 's/ //g'`
# get the length of client_addr
LENGTH=`expr "$client_addr" : '.*'`
if [ $LENGTH -gt 8 ]
then
# add pattern of [1-9][1-9] for parsing since nslookup output might be 
changed 
/usr/sbin/nslookup $client_addr 2> $WORLING_DIR/$TEMP_NAME | awk '{ 
print $2 }' | egrep -e [0-9]'.'[0-9]'.' > nslookup_result
NSR_LINES=`cat nslookup_result | wc -l`
if [ $NSR_LINES -eq 2 ];then
client_digit=`cat nslookup_result 2> $WORLING_DIR/$TEMP_NAME | 
awk '( NR == 2 ) { print $0 }'`
elif [ $NSR_LINES -eq 3 ];then
client_digit=`cat nslookup_result 2> $WORLING_DIR/$TEMP_NAME | 
awk '( NR == 3 ) { print $0 }'`
fi
# remove the result file
rm nslookup_result 2> $WORLING_DIR/$TEMP_NAME
# check whether or not the nslookup command gets a result,which it 
should be larger than 8
LENGTH=`expr "$client_digit" : '.*'`
if [ $LENGTH -gt 8 ]
then
client_ip=$client_digit
fi
fi
# output the result
echo "$client_ip $oracle_date $host_ip" >> $OUTPUT_FILE
let success=success+$?
done 

# get whole NetTracker related lines
whole

RE: UNIX : script help/input

2003-10-02 Thread Norris, Gregory T [ITS]
> Note:
> This message is for the named person's use only.  It may 
> contain confidential, proprietary or legally privileged 
> information.  No confidentiality or privilege is waived or 
> lost by any mistransmission.  If you receive this message in 
> error, please immediately delete it and all copies of it from 
> your system, destroy any hard copies of it and notify the 
> sender.  You must not, directly or indirectly, use, disclose, 
> distribute, print, or copy any part of this message if you 
> are not the intended recipient. Wang Trading LLC and any of 
> its subsidiaries each reserve the right to monitor all e-mail 
> communications through its networks.
> Any views expressed in this message are those of the 
> individual sender, except where the message states otherwise 
> and the sender is authorized to state them to be the views of 
> any such entity.

It looks like this would make a *great* example for the Stupid Email Disclaimers site 
.

--
My employers like me, but not enough to let me speak for them.

Greg Norris
Sprint LTD Database Administration
 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Norris, Gregory T [ITS]
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


RE: UNIX : script help/input

2003-10-02 Thread Jamadagni, Rajendra
Title: RE: UNIX : script help/input





XOR  that gives me some painful memories in recent days ... xor is possible in pl/sql but needs a little work. I migrated a "C" encryption code to pl/sql  and then use utl_tcp to sent it to our router which feeds the modem banks.

This is how I worked on it ... but I was working on character by character ...


xor(a,b) is
r_a := utl_raw.cast_to_raw(chr(a));
r_b := utl_raw.cast_to_raw(chr(b));
n_xor := to_number(utl_raw.bit_xor(r_a,r_b),'');



Of course the manual doesn't tell you this ... 


Raj

Rajendra dot Jamadagni at nospamespn dot com
All Views expressed in this email are strictly personal.
QOTD: Any clod can have facts, having an opinion is an art !



-Original Message-
From: Jared Still [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 01, 2003 6:29 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: UNIX : script help/input



> Good! The more the merrier! Welcome to the club.


Oh most definitely.


As I just finished writing a prototype package for assigning MAC
addresses ( we make network stuff - that's a technical term ), I
have endured the agonies of doing hex math in PL/SQL.


I finally bit the bullet and used string manipulation to convert
hex to decimal and do what I needed that way.  Couldn't get BITAND
to work properly on very large integers. Besides, doing XOR with
BITAND in PL/SQL is very painful.


UTL_RAW has an XOR, but it requires RAW values and I didn't feel
like messing with it.


This is all very simple in Perl.


Given a MAC of 5AA, with a fixed portion of 500,
it is very easy to determine the variable portion of the address
via $x = 0x5AA ^ 500.


Not quite so simple in PL/SQL.


Jared



This e-mail 
message is confidential, intended only for the named recipient(s) above and may 
contain information that is privileged, attorney work product or exempt from 
disclosure under applicable law. If you have received this message in error, or are 
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 
and delete this e-mail message from your computer, Thank 
you.*2


Re: UNIX : script help/input

2003-10-01 Thread Vladimir Begun
Jared

Jared Still wrote:
Good! The more the merrier! Welcome to the club.
Oh most definitely.

As I just finished writing a prototype package for assigning MAC
addresses ( we make network stuff - that's a technical term ), I
have endured the agonies of doing hex math in PL/SQL.
I finally bit the bullet and used string manipulation to convert
hex to decimal and do what I needed that way.  Couldn't get BITAND
to work properly on very large integers. Besides, doing XOR with
BITAND in PL/SQL is very painful.
BITAND in PL/SQL works for INTEGER/PLS_INTEGER only.

UTL_RAW has an XOR, but it requires RAW values and I didn't feel
like messing with it.
This is all very simple in Perl.
Sure!

Given a MAC of 5AA, with a fixed portion of 500,
it is very easy to determine the variable portion of the address
via $x = 0x5AA ^ 500.
Not quite so simple in PL/SQL.
"Globally unique addresses are allocated by the IEEE in blocks containing 2^24
(16,777,216) addresses. In each allocation, the first 3 octects are fixed (e.g.
00-00-0C is Cisco) and the last three octects are variable (e.g. 00-00-00
through FF-FF-FF). The fixed portion of the allocation is known formally as the
Organizationally Unique Identifier (OUI), and infomally as the Ethernet Vendor
ID. Often, the OUI portion of a MAC address is extremely helpful in indentifying
which physical piece of equipment is generating a particular packet."
00-00-50 is for RADISYS CORPORATION, right?

x := SUBSTR('0x50AA', -6);

Then you can use BITAND. However, I'm not saying that PL/SQL is better
than perl -- every language has its own purpose.
--
Vladimir Begun
The statements and opinions expressed here are my own and
do not necessarily represent those of Oracle Corporation.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Vladimir Begun
 INET: [EMAIL PROTECTED]
Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


RE: UNIX : script help/input

2003-10-01 Thread Jared Still
> Good! The more the merrier! Welcome to the club.

Oh most definitely.

As I just finished writing a prototype package for assigning MAC
addresses ( we make network stuff - that's a technical term ), I
have endured the agonies of doing hex math in PL/SQL.

I finally bit the bullet and used string manipulation to convert
hex to decimal and do what I needed that way.  Couldn't get BITAND
to work properly on very large integers. Besides, doing XOR with
BITAND in PL/SQL is very painful.

UTL_RAW has an XOR, but it requires RAW values and I didn't feel
like messing with it.

This is all very simple in Perl.

Given a MAC of 5AA, with a fixed portion of 500,
it is very easy to determine the variable portion of the address
via $x = 0x5AA ^ 500.

Not quite so simple in PL/SQL.

Jared





On Wed, 2003-10-01 at 14:44, Mladen Gogala wrote:
> On Wed, 2003-10-01 at 14:34, Jamadagni, Rajendra wrote:
> > Funny .. I am currently sitting in a Perl class, so I can actually
> > read what MG has written. I'll be soon Perl-literate ...
> >  
> > Raj
> 

> 
> 
> 
> 
> Note:
> This message is for the named person's use only.  It may contain confidential, 
> proprietary or legally privileged information.  No confidentiality or privilege is 
> waived or lost by any mistransmission.  If you receive this message in error, please 
> immediately delete it and all copies of it from your system, destroy any hard copies 
> of it and notify the sender.  You must not, directly or indirectly, use, disclose, 
> distribute, print, or copy any part of this message if you are not the intended 
> recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to 
> monitor all e-mail communications through its networks.
> Any views expressed in this message are those of the individual sender, except where 
> the message states otherwise and the sender is authorized to state them to be the 
> views of any such entity.
> 
> -- 
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> -- 
> Author: Mladen Gogala
>   INET: [EMAIL PROTECTED]
> 
> Fat City Network Services-- 858-538-5051 http://www.fatcity.com
> San Diego, California-- Mailing list and web hosting services
> -
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).
> 


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jared Still
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Re: UNIX : script help/input

2003-10-01 Thread Jared Still
Why thank you.  :)

On Wed, 2003-10-01 at 13:29, Govindan K wrote:
> Thank God for Jared 
> 
> <-Original Message->
> 
>From: Tanel Poder
> Sent: 10/1/2003 10:37:55 AM
> To: [EMAIL PROTECTED]
> 
> 
> Thank God for Perl and Mladen ;)
>  
> Tanel.
>  
> - Original Message - 
> 
>   From: Johan Muller <mailto:[EMAIL PROTECTED]>  
>   To: Multiple recipients of list ORACLE-L
> <mailto:[EMAIL PROTECTED]>  
>   Sent: Wednesday, October 01, 2003 8:24 PM
>   Subject: Re: UNIX : script help/input
> 
>   Mladen,
>
>   It worked! 
>
>   Heartfelt thank you from the evangelized perl crowd (now watch
> the list-owner grin).
>   
>   Mladen Gogala < [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> > wrote:
> 
>   #!/usr/bin/perl -w
>   use strict;
>   use bytes;
>   my ($NAME,$IP,@LB);
>   while (<>) {
>   chomp;
>   @LB=split /\s+/;
>   if ($LB[0] =~ /^name:/i) {
>   $NAME=$LB[1];
>   }
>   if ($LB[0] =~ /^address:/i) {
>   $IP=$LB[1];
>   write;
>   }
>   }
>   format STDOUT=
>   @<<<<<<<<<<<<<<<<<< ,@<<<<<<<<<<<<
>   $NAME,$IP
> 
> 
> ___
> Get Your 10MB account for FREE at http://mail.arabia.com !
> Access MILLIONS of JOBS NOW!
> <http://ads.arabia.com/?SHT=text_email_english> 


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jared Still
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


RE: UNIX : script help/input

2003-10-01 Thread Mladen Gogala
On Wed, 2003-10-01 at 14:34, Jamadagni, Rajendra wrote:
> Funny .. I am currently sitting in a Perl class, so I can actually
> read what MG has written. I'll be soon Perl-literate ...
>  
> Raj

Good! The more the merrier! Welcome to the club.




Note:
This message is for the named person's use only.  It may contain confidential, 
proprietary or legally privileged information.  No confidentiality or privilege is 
waived or lost by any mistransmission.  If you receive this message in error, please 
immediately delete it and all copies of it from your system, destroy any hard copies 
of it and notify the sender.  You must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message if you are not the intended 
recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to 
monitor all e-mail communications through its networks.
Any views expressed in this message are those of the individual sender, except where 
the message states otherwise and the sender is authorized to state them to be the 
views of any such entity.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Mladen Gogala
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Re: UNIX : script help/input

2003-10-01 Thread Govindan K


Thank God for Jared <-Original Message->



 
 
From: Tanel PoderSent: 10/1/2003 10:37:55 AMTo: [EMAIL PROTECTED]Subject: Re: UNIX : script help/input 



Thank God for Perl and Mladen ;)
 
Tanel.
 
- Original Message - 

From: Johan Muller 
To: Multiple recipients of list ORACLE-L 
Sent: Wednesday, October 01, 2003 8:24 PM
Subject: Re: UNIX : script help/input


Mladen,
 
It worked! 
 
Heartfelt thank you from the evangelized perl crowd (now watch the list-owner grin).Mladen Gogala <[EMAIL PROTECTED]> wrote:
#!/usr/bin/perl -wuse strict;use bytes;my ($NAME,$IP,@LB);while (<>) {chomp;@LB=split /\s+/;if ($LB[0] =~ /^name:/i) {$NAME=$LB[1];}if ($LB[0] =~ /^address:/i) {$IP=$LB[1];write;}}format STDOUT=@<<<<<<<<<<<<<<<<<< ,@<<<<<<<<<<<<$NAME,$IP

___Get Your 10MB account for FREE at http://mail.arabia.com !Access MILLIONS of JOBS NOW!

Re: UNIX : script help/input

2003-10-01 Thread Jared Still

:)

On Wed, 2003-10-01 at 10:24, Johan Muller wrote:
> Mladen,
>  
> It worked! 
>  
> Heartfelt thank you from the evangelized perl crowd (now watch the list-owner grin).
> 
> Mladen Gogala <[EMAIL PROTECTED]> wrote:
> #!/usr/bin/perl -w
> use strict;
> use bytes;
> my ($NAME,$IP,@LB);
> while (<>) {
> chomp;
> @LB=split /\s+/;
> if ($LB[0] =~ /^name:/i) {
> $NAME=$LB[1];
> }
> if ($LB[0] =~ /^address:/i) {
> $IP=$LB[1];
> write;
> }
> }
> format STDOUT=
> @<< ,@
> $NAME,$IP


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jared Still
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


RE: UNIX : script help/input

2003-10-01 Thread Jamadagni, Rajendra



Funny 
.. I am currently sitting in a Perl class, so I can actually read what MG has 
written. I'll be soon Perl-literate ...
 
Raj

  -Original Message-From: Tanel Poder 
  [mailto:[EMAIL PROTECTED]Sent: Wednesday, October 01, 2003 
  1:35 PMTo: Multiple recipients of list ORACLE-LSubject: 
  Re: UNIX : script help/input
  Thank God for Perl and Mladen ;)
   
  Tanel.
   
  - Original Message - 
  
From: 
Johan 
Muller 
To: Multiple recipients of list ORACLE-L 

Sent: Wednesday, October 01, 2003 8:24 
PM
Subject: Re: UNIX : script 
    help/input


Mladen,
 
It worked! 
 
Heartfelt thank you from the evangelized perl crowd (now watch the 
list-owner grin).Mladen Gogala <[EMAIL PROTECTED]> 
wrote:
#!/usr/bin/perl 
  -wuse strict;use bytes;my ($NAME,$IP,@LB);while (<>) 
  {chomp;@LB=split /\s+/;if ($LB[0] =~ /^name:/i) 
  {$NAME=$LB[1];}if ($LB[0] =~ /^address:/i) 
  {$IP=$LB[1];write;}}format 
  STDOUT=@<<<<<<<<<<<<<<<<<< 
  ,@<<<<<<<<<<<<$NAME,$IP
This e-mail 
message is confidential, intended only for the named recipient(s) above and may 
contain information that is privileged, attorney work product or exempt from 
disclosure under applicable law. If you have received this message in error, or are 
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 
and delete this e-mail message from your computer, Thank 
you.*2


Re: UNIX : script help/input

2003-10-01 Thread Tanel Poder



Thank God for Perl and Mladen ;)
 
Tanel.
 
- Original Message - 

  From: 
  Johan Muller 
  
  To: Multiple recipients of list ORACLE-L 
  
  Sent: Wednesday, October 01, 2003 8:24 
  PM
  Subject: Re: UNIX : script 
  help/input
  
  
  Mladen,
   
  It worked! 
   
  Heartfelt thank you from the evangelized perl crowd (now watch the 
  list-owner grin).Mladen Gogala <[EMAIL PROTECTED]> 
  wrote:
  #!/usr/bin/perl 
-wuse strict;use bytes;my ($NAME,$IP,@LB);while (<>) 
{chomp;@LB=split /\s+/;if ($LB[0] =~ /^name:/i) 
{$NAME=$LB[1];}if ($LB[0] =~ /^address:/i) 
{$IP=$LB[1];write;}}format 
STDOUT=@<<<<<<<<<<<<<<<<<< 
,@<<<<<<<<<<<<$NAME,$IP


Re: UNIX : script help/input

2003-10-01 Thread Mladen Gogala
On Wed, 2003-10-01 at 13:24, Johan Muller wrote:
> Mladen,
>  
> It worked! 
>  

Did you have any doubts? That's precisely what perl is good for.





Note:
This message is for the named person's use only.  It may contain confidential, 
proprietary or legally privileged information.  No confidentiality or privilege is 
waived or lost by any mistransmission.  If you receive this message in error, please 
immediately delete it and all copies of it from your system, destroy any hard copies 
of it and notify the sender.  You must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message if you are not the intended 
recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to 
monitor all e-mail communications through its networks.
Any views expressed in this message are those of the individual sender, except where 
the message states otherwise and the sender is authorized to state them to be the 
views of any such entity.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Mladen Gogala
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Re: UNIX : script help/input

2003-10-01 Thread Johan Muller

Mladen,
 
It worked! 
 
Heartfelt thank you from the evangelized perl crowd (now watch the list-owner grin).Mladen Gogala <[EMAIL PROTECTED]> wrote:
#!/usr/bin/perl -wuse strict;use bytes;my ($NAME,$IP,@LB);while (<>) {chomp;@LB=split /\s+/;if ($LB[0] =~ /^name:/i) {$NAME=$LB[1];}if ($LB[0] =~ /^address:/i) {$IP=$LB[1];write;}}format STDOUT=@<< ,@$NAME,$IP

Re: UNIX : script help/input

2003-10-01 Thread Mladen Gogala
#!/usr/bin/perl -w
use strict;
use bytes;
my ($NAME,$IP,@LB);
while (<>) {
chomp;
@LB=split /\s+/;
if ($LB[0] =~ /^name:/i) {
   $NAME=$LB[1];
   }
if ($LB[0] =~ /^address:/i) {
   $IP=$LB[1];
   write;
   }
}
format STDOUT=
@<< ,@
$NAME,$IP


Re: UNIX : script help/input

2003-10-01 Thread Joe Testa
I supposed if you send to a file, we can read it using ORACLE to parse 
it w/plsql and then using utl_file write it back out but seems like 
overkill to use oracle for that, but then again this is an oracle list, 
so i'll have to assume thats what you wanted, anyone up for the task :)

joe

Johan Muller wrote:

Anybody with a quick and dirty (elegant would be nice too), to munge 
output from a nslookup output file to a delimited file?

'File content:

Server:  dns1.mci.com
Address:  199.249.19.1
Name:WCOM-4NXZGAPWY5.mcilink.com
Address:  166.50.73.209
Delimited file should have the following line(s);  (using | or 
whatever as delimiter):

'166.50.73.209'|'4NXZGAPWY5.mcilink.com'.

Required for both single and multiple records.

 

TIA

--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Joe Testa
 INET: [EMAIL PROTECTED]
Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


RE: UNIX : script help/input

2003-10-01 Thread Stephane Faroult
>
>Anybody with a quick and dirty (elegant would be
>nice too), to munge output from a nslookup output
>file to a delimited file?
>
>'File content:
>
>Server:  dns1.mci.com
>Address:  199.249.19.1
>
>Name:WCOM-4NXZGAPWY5.mcilink.com
>Address:  166.50.73.209
>
>Delimited file should have the following line(s); 
>(using | or whatever as delimiter):
>
>'166.50.73.209'|'4NXZGAPWY5.mcilink.com'.
>
>Required for both single and multiple records.
>
> 
>
>TIA

awk 'BEGIN{ok=0;}\
 {if (($1 == "Address:) && ok)\
 {printf("%s|%s\n", $2, name);ok=0;}\
  else {if ($1 == "Name:")\
   {name = $2; ok = 1;}}}' your_file_here

Don't understand your 'single' and 'multiple' records too well but it should get you 
started.

Regards,

Stephane Faroult
Oriole
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Stephane Faroult
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).