Sponsored Content
Top Forums Shell Programming and Scripting nawk: illegal statement at source line 1 Post 302350401 by bhaire on Thursday 3rd of September 2009 05:03:26 PM
Old 09-03-2009
nawk: illegal statement at source line 1

Hello Everyone,

I don't know what is wrong with this:

Quote:
$ps -ef|grep java > processup.txt
$nawk '$0 !~ /mytomcat/{startup.sh}' processup.txt
nawk: syntax error at source line 1
context is
$0 !~ >>> /mytomcat/{startup. <<< sh}
nawk: illegal statement at source line 1
Is it that nawk cannot run a ".sh" script or is it not treating "." as a literal. If so how to make "." be treated as a literal in "nawk" statemnts?

Thanks in Advance
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I can't seem to pass variables properly into a nawk statement

Ok, So up front I'm going to say that I'm a very elementary scripter, and I tend to use tools I don't fully understand, but I shotgun at something until I can get it to work...that said, I can't for the life of me understand why I can't get this to go down the way I want it to. The goal: -to... (6 Replies)
Discussion started by: DeCoTwc
6 Replies

2. Shell Programming and Scripting

Need to remove first character from every third line (or revised nawk).

Here's the data I'm starting with (example output of two combined queries, filesize: 284k) 3000877|555-55-1111|2|7/30/2008|TEST|P.O. BOX 1111|PALM DESERT|CA|92211||5555555555||||||||48|||1||1|3|||2|||||||||||||1|3||2|2... (6 Replies)
Discussion started by: VPREATR
6 Replies

3. Shell Programming and Scripting

Illegal Statement at source line 2

Hello I'm pretty new to Shell Programming and I'm trying to write a script to display the out of a file displaying licence-use for an application. I've piped the output of my licence-use query to a file. On this file I am trying to run the following awk file, but I keep getting the error: ... (6 Replies)
Discussion started by: Glyn_Mo
6 Replies

4. UNIX for Dummies Questions & Answers

nawk: syntax error at source line 11

Hi, I executing a awk in a shell script. A part of AWK is: nawk -F"¤" -v fichero=${DIRECTORIO_PARAMETROS}/${FICHERO_CONFIGURACION_CHEQUEOS} -v sistema=${SISTEMA_SEDRA} -v fichero_no_validos="No_validos_CAMPO_TIPO_${SIST}.dat" 'BEGIN{ if ( fichero != "") { ... (4 Replies)
Discussion started by: pepeli30
4 Replies

5. AIX

can't parse this nawk statement

hi all i have the following portion in an xml file: </n:AOMessage> <?xml version="1.0" encoding="UTF-8"?> <n:AOMessage xmlns:n="urn:ao:hs:update:shell" xmlns:bo="urn:ao:hs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ao:hs:update:shell... (0 Replies)
Discussion started by: chipahoys
0 Replies

6. Shell Programming and Scripting

ksh/nawk help with if statement to choose between 2 files

Hi! I am having a bit of a problem with my script. There are two different date formats that may appear in a file, either Jul-12 or Jul--6. I tried to create an if statement that searches for one of the formats and if that doesn't exist searches for the other, however it doesn't seem to be... (3 Replies)
Discussion started by: ther2000
3 Replies

7. Shell Programming and Scripting

nawk and line number

Hi I am using the following "nawk" statement to get 22 lines after the pattern I have specified as an argument: $ NUM=3461 $ nawk -v a=$NUM '$0 ~ ("\\") {c=22}c&&c--' myfile The "nawk" statement works fine. But I also need to get line numbers as a part of the output. Is there a way to... (2 Replies)
Discussion started by: aoussenko
2 Replies

8. Shell Programming and Scripting

Help with finding last line of file: if statement depending on that line.

Good morning, My first time actually posting in this forum, though I have used this forum to help with numerous projects. I am trying to figure out why my if statement does not work. I have a file where a line is inputted every 15 seconds. I want this if statement to check what the last line... (3 Replies)
Discussion started by: Shanrunt
3 Replies

9. Shell Programming and Scripting

Read: line 6: illegal option -e

For some reason read -e isn't working in my script. I need a directory as input from a user and I'd like for them to be able to use tab complete which is why I'm using -e. When the script is run, I get: read: line 6: illegal option -e In order to just figure out what is going on with the -e... (4 Replies)
Discussion started by: orangeSunshine
4 Replies

10. Shell Programming and Scripting

Adding a String after a text in a Line (using nawk)

Hello I need to add a String after a text in a line. The Unix file is huge and I think nawk would be quick. Current: -name FILTER -node 60265 -cob 31/01/2013 -risktype + -change 1 -filter ALL_NODES -toponly -warnings OFF -delimiter "|" -noheader -select... (4 Replies)
Discussion started by: filter
4 Replies
AMPLOT(8)						      System Manager's Manual							 AMPLOT(8)

NAME
amplot - visualize the behavior of Amanda SYNOPSIS
amplot [ -c ] [ -e ] [ -g ] [ -l ] [ -p ] [ -t T ] amdump_files DESCRIPTION
Amplot reads an amdump output file that Amanda generates each run (e.g. amdump.1) and translates the information into a picture format that may be used to determine how your installation is doing and if any parameters need to be changed. Amplot also prints out amdump lines that it either does not understand or knows to be warning or error lines and a summary of the start, end and total time for each backup image. Amplot is a shell script that executes an awk program (amplot.awk) to scan the amdump output file. It then executes a gnuplot program (amplot.g) to generate the graph. The awk program is written in an enhanced version of awk, such as GNU awk (gawk version 2.15 or later) or nawk. During execution, amplot generates a few temporary files that gnuplot uses. These files are deleted at the end of execution. See the amanda(8) man page for more details about Amanda. OPTIONS
-c Compress amdump_files after plotting. -e Extend the X (time) axis if needed. -g Direct gnuplot output directly to the X11 display (default). -p Direct postscript output to file YYYYMMDD.ps (opposite of -g). -l Generate landscape oriented output. -t T Set the right edge of the plot to be T hours. The amdump_files may be in various compressed formats (compress, gzip, pact, compact). INTERPRETATION
The figure is divided into a number of regions. There are titles on the top that show important statistical information about the configu- ration and from this execution of amdump. In the figure, the X axis is time, with 0 being the moment amdump was started. The Y axis is divided into 5 regions: QUEUES: How many backups have not been started, how many are waiting on space in the holding disk and how many have been transferred successfully to tape. %BANDWIDTH: Percentage of allowed network bandwidth in use. HOLDING DISK: The higher line depicts space allocated on the holding disk to backups in progress and completed backups waiting to be written to tape. The lower line depicts the fraction of the holding disk containing completed backups waiting to be written to tape including the file currently being written to tape. The scale is percentage of the holding disk. TAPE: Tape drive usage. %DUMPERS: Percentage of active dumpers. The idle period at the left of the graph is time amdump is asking the machines how much data they are going to dump. This process can take a while if hosts are down or it takes them a long time to generate estimates. AUTHOR
Olafur Gudmundsson ogud@tis.com Trusted Information Systems formerly at University of Maryland, College Park BUGS
Reports lines it does not recognize, mainly error cases but some are legitimate lines the program needs to be taught about. SEE ALSO
amanda(8), amdump(8), gawk(1), nawk(1), awk(1), gnuplot(1), sh(1), compress(1), gzip(1) 4th Berkeley Distribution AMPLOT(8)
All times are GMT -4. The time now is 08:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy