RE: One for bash experts....

2003-08-04 Thread Stephen Lee

The Linux cognoscenti, in all their infinite wisdom, have decided you should
no longer be using nawk; you should be using gawk instead.  And you can no
longer expect things that were in /usr/bin to be there henceforth.  Again,
in their infinite wisdom, they have decided that there is a more appropriate
location for the various and sundry utilities; so they took the liberty of
moving things around.

They apparently ignored by suggestion that up their collective ass is the
best place.


-Original Message-
Sent: Monday, August 04, 2003 9:40 AM
To: Multiple recipients of list ORACLE-L


I've got the following script that works fine on most flavours of unix apart
from Linux...I think I must be going mad as I can't see where the problem is

I get the following error when i invoke it.

oracle ukwsv71  usedb uktst233
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
ORACLE_HOME = [/oracle/app/oracle] ? 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Stephen Lee
  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: One for bash experts....

2003-08-04 Thread Matthew Zito
Title: Message



It's 
looking for the command "nawk" - either find a source package and install it, or 
change your script to call awk instead. I'm not sure of any differences 
between awk and nawk, but you could give it a shot.

Thanks,
Matt
--Matthew ZitoGridApp SystemsEmail: 
[EMAIL PROTECTED]Cell: 646-220-3551Phone: 212-358-8211 x 359http://www.gridapp.com 

  
  -Original Message-From: 
  [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of 
  Zabair AhmedSent: Monday, August 04, 2003 10:40 
  AMTo: Multiple recipients of list ORACLE-LSubject: One 
  for bash experts
  I've got the following script that works fine on most flavours of unix 
  apart from Linux...I think I must be going mad as I can't see where the 
  problemis
  
  I get the following error when i invoke it.
  
  
  oracle ukwsv71  usedb uktst233
  bash: nawk: command not found
  bash: nawk: command not found
  bash: nawk: command not found
  bash: nawk: command not found
  bash: nawk: command not found
  bash: nawk: command not found
  bash: nawk: command not found
  ORACLE_HOME = [/oracle/app/oracle] ? 
  
  TIA
  
  #--# 
  File: 
  usedb# 
  System: Information 
  System# Description: 
  This validates and sets up the oracle 
  environment# 
  based on the database name.# 
  Parameters: database name upper or lower 
  case# 
  # 
  Notes: "This should be 
  bomb proof but so were many 
  #embasies!"# 
  It runs in the current shell . ## 
  Korn/Bash command line usage # 
  # . 
  /proj/oracle/scripts/usedb 
  ukprd33## Bourne command line 
  usage # 
  # 
  usedb=ukprd33 . /proj/oracle/scripts/usedb# 
  # Interactive use Korn/Bourne or 
  Bash# 
  ---# . 
  /proj/oracle/scripts/usedb#oracle ukwsv71  cat 
  usedb#--# 
  File: 
  usedb# 
  System: Information 
  System# Description: 
  This validates and sets up the oracle 
  environment# 
  based on the database name.# 
  Parameters: database name upper or lower 
  case# 
  # 
  Notes: "This should be 
  bomb proof but s! o were many 
  embasies!"# 
  It runs in the current shell . ## 
  Korn/Bash command line usage # 
  # . 
  /proj/oracle/scripts/usedb 
  ukprd33## Bourne command line 
  usage # 
  # 
  usedb=ukprd33 . /proj/oracle/scripts/usedb# 
  # Interactive use Korn/Bourne or 
  Bash# 
  ---# . 
  /proj/oracle/scripts/usedb## Using 
  an alias Korn or Bash# 
  ---# alias 
  usedb='. /proj/oracle/scripts/usedb'# 
  usedb uktst33# 
  or# usedb## 
  Date 
  Who Comments# 
   === 
  # 20-08-98 
  MJE (Kentlong Ltd.) Glaxowellcome# 
  28-04-98 MJE Updated for 
  HPUX# 10-06-99 MJE 
  Hunt for oratab back in looking at listener is 
  # 
  unreliable. Looks for the tnsnames file in 
  standard# 
  place. Removes all environment setings and oracle 
  # 
  path seting at the start.# 08-07-99 
  MJE Changed to work in bourne shell from the command 
  line.# 30-11-99 IAF 
  Test for Oracle 8.1.5 so as to set up 
  LD_LIBRARY_PATH# 
  to point to additional directory /usr/ucblink.# 
  06-03-00 MJE Changed 
  code to ignore links when looking for oratab# 07 Aug 2001 M 
  Sabet Fixed the problem with ! the new format of the combined 
  # merged fSB and fGW tnsnames file. 
  This script basically stopped 
  working.# But now it should cope with 
  both the old and new combined formats. It 
  is# always best to stick to just one 
  format and indentation for the 
  tnsnames# entries if possible. It 
  makes it easier to work 
  with.##--
  # Set up names for Information and error processingNODENAME=`uname 
  -n`SCRIPT=$0INFO=$NODENAME"::usedb: "ERROR=$NODENAME"::usedb: 
  Error "
  # If the operating system is HP-UX then the $NAWK command = awk else use 
  $NAWK.# Under HP-UX $NAWK does not exist but the $NAWK functions are 
  included with awkif [ `uname -s|awk '{print substr($0,1,3)}'` = "HP-" ] ; 
  then NAWK=awkelse NAWK=nawkfi
  if [ -z "$usedb" ] ; then usedb=$1fi
  unset OTAB OTABFILE TNSNAMES VNAM LOCATION TWO_TASK ORACLE_SID 
  ORACLE_HOME
  # If the database name has not been passed in on the command 
  linewhile [ -z "$usedb" ] ; do echo "Please enter database 
  name e.g. UKTST01 " read usedb 
echodone
  # Fiddle abort loopwhile true ; do
  # Find the ORATAB fileOTAB=`find /etc /var/opt -type f -name oratab 
  -print 2/dev/null`if [ -z "$OTAB" ] ; then error "The ORATAB 
  file was not found." unset OTAB OTABFILE TNSNAMES VNAM LOCATION 
  usedb breakfi
  # Strip multiple /usr/local/bin (s) from the path and make sure 
  /usr/local/bin# is firstPATH="/usr/local/bin:"`echo $PATH|sed 
  's?/usr/local/bin??g'`
  # Strip all 

RE: One for bash experts....

2003-08-04 Thread Jared . Still
Yes, there are differences between nawk and awk.

Scripts written for nawk may not work on awk.

Don't ask me why, check the man pages. :)

Jared





Matthew Zito [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
 08/04/2003 11:19 AM
 Please respond to ORACLE-L

 
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
cc: 
Subject:RE: One for bash experts


It's looking for the command nawk - either find a source package and 
install it, or change your script to call awk instead.  I'm not sure of 
any differences between awk and nawk, but you could give it a shot.
 
Thanks,
Matt
--
Matthew Zito
GridApp Systems
Email: [EMAIL PROTECTED]
Cell: 646-220-3551
Phone: 212-358-8211 x 359
http://www.gridapp.com 
-Original Message-
Sent: Monday, August 04, 2003 10:40 AM
To: Multiple recipients of list ORACLE-L

I've got the following script that works fine on most flavours of unix 
apart from Linux...I think I must be going mad as I can't see where the 
problem is
 
I get the following error when i invoke it.
 
oracle ukwsv71  usedb uktst233
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
ORACLE_HOME = [/oracle/app/oracle] ? 
 
TIA
 
#--
#   File:   usedb
#   System: Information System
#   Description:This validates and sets up the oracle environment
#   based on the database name.
#   Parameters: database name upper or lower case
# 
#   Notes:  This should be bomb proof but so were many 
#embasies!
#   It runs in the current shell . 
#
#   Korn/Bash command line usage 
#   
#   . /proj/oracle/scripts/usedb ukprd33
#
#   Bourne command line usage 
#   
#   usedb=ukprd33 . /proj/oracle/scripts/usedb
# 
#   Interactive use Korn/Bourne or Bash
#   ---
#   . /proj/oracle/scripts/usedb
#
oracle ukwsv71   cat usedb
#--
#   File:   usedb
#   System: Information System
#   Description:This validates and sets up the oracle environment
#   based on the database name.
#   Parameters: database name upper or lower case
# 
#   Notes:  This should be bomb proof but s! o were many 
embasies!
#   It runs in the current shell . 
#
#   Korn/Bash command line usage 
#   
#   . /proj/oracle/scripts/usedb ukprd33
#
#   Bourne command line usage 
#   
#   usedb=ukprd33 . /proj/oracle/scripts/usedb
# 
#   Interactive use Korn/Bourne or Bash
#   ---
#   . /proj/oracle/scripts/usedb
#
#   Using an alias Korn or Bash
#   ---
#   alias usedb='. /proj/oracle/scripts/usedb'
#   usedb uktst33
# or
#   usedb
#
# Date  Who Comments
#   === 
# 20-08-98  MJE (Kentlong Ltd.) Glaxowellcome
# 28-04-98  MJE Updated for HPUX
# 10-06-99  MJE Hunt for oratab back in looking at listener is 
#   unreliable. Looks for the tnsnames file in 
standard
#   place. Removes all environment setings and oracle 
#   path seting at the start.
# 08-07-99  MJE Changed to work in bourne shell from the command 
line.
# 30-11-99  IAF Test for Oracle 8.1.5 so as to set up 
LD_LIBRARY_PATH
#   to point to additional directory  /usr/ucblink.
# 06-03-00  MJE Changed code to ignore links when looking for 
oratab
# 07 Aug 2001 M Sabet   Fixed the problem with ! the new format of the 
combined 
#   merged fSB and fGW tnsnames file. This script basically stopped 
working.
#   But now it should cope with both the old and new combined formats. 
It is
#   always best to stick to just one format and indentation for the 
tnsnames
#   entries if possible. It makes it easier to work with.
#
#--
# Set up names for Information and error processing
NODENAME=`uname -n`
SCRIPT=$0
INFO=$NODENAME::usedb: 
ERROR=$NODENAME::usedb: Error 
# If the operating system is HP-UX then the $NAWK command = awk else use 
$NAWK.
# Under HP-UX $NAWK does not exist but the $NAWK functions are included 
with awk
if [ `uname -s|awk '{print substr($0,1,3)}'` = HP- ] ; then
  NAWK=awk
else
  NAWK=nawk
fi
if [ -z $usedb ] ; then
  usedb=$1
fi
unset OTAB OTABFILE TNSNAMES VNAM LOCATION TWO_TASK ORACLE_SID ORACLE_HOME
# If the database

RE: One for bash experts....

2003-08-04 Thread Molina, Gerardo
We use a case statement to setup various utilities such as nawk/gawk,
mailx/mail, which gets selected depends on platform (uname -s).  This makes
our scripts portable across various Unix platforms as well as Linux.

Gerardo

-Original Message-
Sent: Monday, August 04, 2003 11:24 AM
To: Multiple recipients of list ORACLE-L



The Linux cognoscenti, in all their infinite wisdom, have decided you should
no longer be using nawk; you should be using gawk instead.  And you can no
longer expect things that were in /usr/bin to be there henceforth.  Again,
in their infinite wisdom, they have decided that there is a more appropriate
location for the various and sundry utilities; so they took the liberty of
moving things around.

They apparently ignored by suggestion that up their collective ass is the
best place.


-Original Message-
Sent: Monday, August 04, 2003 9:40 AM
To: Multiple recipients of list ORACLE-L


I've got the following script that works fine on most flavours of unix apart
from Linux...I think I must be going mad as I can't see where the problem is

I get the following error when i invoke it.

oracle ukwsv71  usedb uktst233
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
bash: nawk: command not found
ORACLE_HOME = [/oracle/app/oracle] ? 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Stephen Lee
  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: Molina, Gerardo
  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: One for bash experts....

2003-08-04 Thread Reginald . W . Bailey

Obviously the NAWK executable, nawk, is not in the path or is not
installed.  Find out where the file is located using the find command, then
include that directory in the PATH statement in the .profile file.

RWB



Reginald W. Bailey
IBM Global Services - ETS SW GDSD - Database Management
Your Friendly Neighborhood DBA
713-216-7703 (Office) 281-798-5474 (Mobile) 713-415-5410 (Pager)
[EMAIL PROTECTED]
[EMAIL PROTECTED]


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  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: One for bash experts....

2003-08-04 Thread Stephen Lee

The original AWK had bugs.  So New AWK was written to fix those; and I
suppose some additional functionality was added while they were at it.  I
haven't verified it for the case of awk/nawk, but often these kinds of
programs end up being a single program that examines its command line to see
how it was called; then it behaves accordingly.

It is indeed a mystery as to why the Linux cognoscenti left awk in the
distribution, but tossed nawk when -- as they look down their collective
nose and wave their collective finger at you -- you should be using gawk.

Now there's always the duct tape and bailing wire rig of soft links 


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Monday, August 04, 2003 1:59 PM
 To: Multiple recipients of list ORACLE-L
 Subject: RE: One for bash experts
 
 
 Yes, there are differences between nawk and awk.
 
 Scripts written for nawk may not work on awk.
 
 Don't ask me why, check the man pages. :)
 
 Jared
 
 
 
 
 
 Matthew Zito [EMAIL PROTECTED]
 Sent by: [EMAIL PROTECTED]
  08/04/2003 11:19 AM
  Please respond to ORACLE-L
 
  
 To: Multiple recipients of list ORACLE-L 
 [EMAIL PROTECTED]
 cc: 
 Subject:RE: One for bash experts
 
 
 It's looking for the command nawk - either find a source 
 package and 
 install it, or change your script to call awk instead.  I'm 
 not sure of 
 any differences between awk and nawk, but you could give it a shot.
  
 Thanks,
 Matt
 --
 Matthew Zito
 GridApp Systems
 Email: [EMAIL PROTECTED]
 Cell: 646-220-3551
 Phone: 212-358-8211 x 359
 http://www.gridapp.com 
 -Original Message-
 Sent: Monday, August 04, 2003 10:40 AM
 To: Multiple recipients of list ORACLE-L
 
 I've got the following script that works fine on most 
 flavours of unix 
 apart from Linux...I think I must be going mad as I can't see 
 where the 
 problem is
  
 I get the following error when i invoke it.
  
 oracle ukwsv71  usedb uktst233
 bash: nawk: command not found
 bash: nawk: command not found
 bash: nawk: command not found
 bash: nawk: command not found
 bash: nawk: command not found
 bash: nawk: command not found
 bash: nawk: command not found
 ORACLE_HOME = [/oracle/app/oracle] ? 
  
 TIA
  
 #-
 -
 #   File:   usedb
 #   System: Information System
 #   Description:This validates and sets up the oracle 
 environment
 #   based on the database name.
 #   Parameters: database name upper or lower case
 # 
 #   Notes:  This should be bomb proof but so were many 
 #embasies!
 #   It runs in the current shell . 
 #
 #   Korn/Bash command line usage 
 #   
 #   . /proj/oracle/scripts/usedb ukprd33
 #
 #   Bourne command line usage 
 #   
 #   usedb=ukprd33 . /proj/oracle/scripts/usedb
 # 
 #   Interactive use Korn/Bourne or Bash
 #   ---
 #   . /proj/oracle/scripts/usedb
 #
 oracle ukwsv71   cat usedb
 #-
 -
 #   File:   usedb
 #   System: Information System
 #   Description:This validates and sets up the oracle 
 environment
 #   based on the database name.
 #   Parameters: database name upper or lower case
 # 
 #   Notes:  This should be bomb proof but s! o were many 
 embasies!
 #   It runs in the current shell . 
 #
 #   Korn/Bash command line usage 
 #   
 #   . /proj/oracle/scripts/usedb ukprd33
 #
 #   Bourne command line usage 
 #   
 #   usedb=ukprd33 . /proj/oracle/scripts/usedb
 # 
 #   Interactive use Korn/Bourne or Bash
 #   ---
 #   . /proj/oracle/scripts/usedb
 #
 #   Using an alias Korn or Bash
 #   ---
 #   alias usedb='. /proj/oracle/scripts/usedb'
 #   usedb uktst33
 # or
 #   usedb
 #
 # Date  Who Comments
 #   === 
 # 20-08-98  MJE (Kentlong Ltd.) Glaxowellcome
 # 28-04-98  MJE Updated for HPUX
 # 10-06-99  MJE Hunt for oratab back in looking at 
 listener is 
 #   unreliable. Looks for the tnsnames file in 
 standard
 #   place. Removes all environment 
 setings and oracle 
 #   path seting at the start.
 # 08-07-99  MJE Changed to work in bourne shell from 
 the command 
 line.
 # 30-11-99  IAF Test for Oracle 8.1.5 so as to set up 
 LD_LIBRARY_PATH
 #   to point to additional directory  
 /usr/ucblink.
 # 06-03-00  MJE Changed code to ignore links when looking for 
 oratab