Re: Admin script has syntax errors...
Posted in 2001
I may have been too succinct. The scripts were written by: X#!/usr/bin/ksh X# dbspace-space.sh - Display vital stats on all dbspaces X# Author: Jacob Salomon X# JakeSalomon@netscape.net X# Jun 16, 1999 ========================== XTitle: dbspace-space.sh XAuthor: Jacob Salomon X JakeSalomon@netscape.net XDate: 1999-07-27 XPrerequisite Program: beautify-unl.sh X XShort Description: X A relatively quick & painless utility to display the space available X in all dbspaces in the current system. ============================= XNote that you can obtain the beautify-unl.sh utility from the IIUG Xsoftware archives at URL: Xhttp://www.iiug.org/members/memb_software/archive/beautify_unl ============================= I'm using an Sun E3000 with Solaris 7 Thanks, Denmark W. > You forgot to tell us what OS+Ver you are using, and what shell. > > > Hello Listers, > > I downloaded some DBA scripts from the Internet; however, I'm having > difficulty with one that supposed to arrange the data in a .unl file to line > up the "|" > field separators. > The "beautify-unl.sh" script is called by another script that creates a > ".unl" file with dbspace space information. This ".unl" file is used as an > argument to the > "beautify-unl.sh" script. > > I got two errors at first. One had to do with invalid parameters used with > grep. > I corrected it as follows: > if ( echo $1 | grep $delim_pattern ) > #if ( echo $1 | grep -q -e $delim_pattern ) > > The other error has to do with the syntax of awk commands: > bbankmain{informix}/sfw/informix>./beautify-unl.sh cco.unl > awk: syntax error near line 1 > awk: bailing out near line 1 > > Here is an extract: > awk -v myfs="$delim" ' > # Inputs a pipe-delimited unl file and outputs it in a format so that > # each column maintains its width. The result is that the delimited > # columns appear straight and vertical. > # > BEGIN { > ... > > I would appreciate any help identifying the correct syntax. > > Regards, > > Denmark W. > > "Knowledge is power, but it is only useful if it is shared!"