Re: Admin script has syntax errors...
Posted in 2001
awg, vendor supplied awks are terrible. I'll put money on it that the deveopler of your script hasnt used the traditional awk. Suggest changing the references to awk to nawk which will give you better ideas on the error or better yet, use gawk brett "Denmark B. Weatherburn" wrote: > > 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!" > > ------------------------------------------------------------------------ > Name: beautify-unl.sh > beautify-unl.sh Type: Bourne Shell Program (application/x-sh) > Encoding: quoted-printable -- ----------------------------------------------------------------- Brett's 11th law of UNIX administration... Users think that Y2K was a non-event... well... They havn't got our overtime bills yet :) ----------------------------------------------------------------- Brett Geer - UNIX Admin/Analyst/Programmer - Intratex Holdings. Tel. +27 31 717 4000 Direct. +27 31 717 4146 Fax. +27 31 717 4001 ----------------------------------------------------------------- The little voices are talking to me again, telling me to reach for a keyboard and type rm -rf /* last week they had me rm -rf `echo $MANPATH | sed 's/:/ /g'` now I fear I have no answers -----------------------------------------------------------------