Sponsored Content
Top Forums Shell Programming and Scripting awk script giving unstable results Post 302341914 by Anteus on Friday 7th of August 2009 02:02:03 AM
Old 08-07-2009
Quote:
Originally Posted by danmero
Try:
Code:
psg ServTest' | awk '! /vi|awk/ && $8 == "ServTest" { print "ServTest Present" }'

Code:
 
syntax error at line 2 : `'' unmatched


Last edited by Anteus; 08-07-2009 at 03:19 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script giving wrong results....

hi, I have this script which gives me the result... #! /usr/bin/sh set -x cd /home/managar a=1 while true do if then echo " File log.txt exists in this directory " exit 0 fi echo " File has not arrived yes..." sleep 3 let a=a+1 if then (1 Reply)
Discussion started by: mgirinath
1 Replies

2. Shell Programming and Scripting

egrep not giving desired results

I have written a shell script which looks like below: grep -v ',0,' ./DATA/abc.001 > ./DATA/abc.mid egrep $GREPSEARCH ./DATA/ebc.mid > ./DATA/abc.cut the variable GREPSEARCH has values like the below: ... (3 Replies)
Discussion started by: igandu
3 Replies

3. HP-UX

find -mtime giving strage results in HP-UX

Hi, I am using HP-UX B.11.23 U ia64 I am trying to retrieve files using -mtime option of find command However I found that -mtime is not giving correct results Following is the output of commands executed on 03-Dec-2009 It can be seen that -mtime +1 should have returned all... (2 Replies)
Discussion started by: Chetanaz
2 Replies

4. Shell Programming and Scripting

awk script to parse results from TWO files

I am trying to parse two files and get data that does not match in one of the columns ( column 3 in my case ) Data for two files are as follows A.txt ===== abc 10 5 0 1 16 xyz 16 1 1 0 18 efg 30 8 0 2 40 ijk 22 2 0 1 25 B.txt ===== abc... (6 Replies)
Discussion started by: roger67
6 Replies

5. Shell Programming and Scripting

Sed in vi - \r and \n not giving desired results

I use many different machines at work, each with different versions of o/s's and installed applications. Sed in vi is particularly inconvenient in the sense that sometimes it will accept the "\r" as a carriage return, sometimes not. Same thing with "\n". For instance, if I have a list of hosts... (7 Replies)
Discussion started by: MaindotC
7 Replies

6. Shell Programming and Scripting

awk sum giving incorrect value

cat T|awk -v format=$format '{ SUM += $1} END { printf format,SUM}' the file T has below data usghrt45tf:hrguat:/home/hrguat $ cat T -1363000.00123456789 -95000.00789456123 -986000.0045612378 -594000.0015978 -368939.54159753258415 -310259.0578945612 -133197.37123456789... (4 Replies)
Discussion started by: zulfi123786
4 Replies

7. Shell Programming and Scripting

Solaris script using awk giving errors - please advise

I'm using solaris 10 Scenario as follows I have a logfile with 2 columns: column 1 = source directory + filename column 2 = destination directory + filename Using cron, my script polls for new files and adds them to the logfile ($ELOG) as described above. Using sed, the distination... (2 Replies)
Discussion started by: davidra
2 Replies

8. UNIX for Dummies Questions & Answers

Grep not giving expected results

Version: RHEL 5.8 I am doing a grep of the piped output from ps command as shown below. I am grepping for the pattern ora_dbw* . But, in the result set I am seeing strings with ora_dbr* as well like ora_dbrm_SDLM1DAS3 as shown below. Any idea why is this happening ? $ ps -ef | grep... (6 Replies)
Discussion started by: John K
6 Replies

9. Shell Programming and Scripting

Comm giving unexpected results

Hi I am comparing two files with comm -13 < (sort acc11.txt) < (sort acc12.txt) > output.txt purpose: Get non matching records which are in acc12 but not in acc11... TI am getting WRONG output. Is there any constraints with record length with comm? The above files are the two consective ... (2 Replies)
Discussion started by: vedanta
2 Replies

10. Shell Programming and Scripting

awk - saving results of external script to variable.

So, I've been playing with speeding up some analysis we do by using multiple threads of awk (actually, mawk, but code-compatible as far as I use it) on multiple CPU cores. So, I have a big data file and I have several copies of exactly the same processor script, written in mawk. I also have a... (8 Replies)
Discussion started by: treesloth
8 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 06:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy