The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
hOW TO PUT OUTPUT OF TWO ECHO STATEMENT IN ONE LINE scorp_rahul23 Shell Programming and Scripting 3 09-22-2008 06:30 AM
single line if statement ankimo UNIX for Dummies Questions & Answers 2 09-21-2008 07:43 PM
grep entire statement not just line shantanuo UNIX for Dummies Questions & Answers 3 08-28-2008 01:48 PM
Illegal function call naren_chella High Level Programming 6 05-25-2006 01:27 AM
2489 Illegal instruction ana UNIX for Dummies Questions & Answers 1 01-14-2005 11:11 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-19-2009
Glyn_Mo Glyn_Mo is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 16
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:

bash-3.00$ nawk -f ~/viewlicences.awk ~/licences

nawk: syntax error at source line 2
context is
if ($0 /Users of >>> SYNERGY-CMBase/) <<<
nawk: illegal statement at source line 2


This is my awk script that I'm trying to run on the file:

1 {
2 if ($0 [/Users of SYNERGY-CMBase/])
3 {
4 while ("x" == "x")
5 {
6 getline var
7 if (var == "") { continue }
8 if (var != /Users of SYNERGY-GroupSecurity/) { print var } else { exit }
9 }
10 }
11 }


I'm basically trying to capture output between the line which which says "Users of SYNERGY-CMBase" and Users of "SYNERGY-GroupSecurity".

Any advice would be greatly appreciated.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:58 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0