quick check of my awk syntax


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers quick check of my awk syntax
# 1  
Old 07-06-2005
quick check of my awk syntax

I've made an awk command that works successfully.
However I'd like to add one character to it.

For example instead of /what_i_have_now/
I'd like to change just ONE field to the opposite with an exclamation point.

Like this: ! /what_i_have_now/

My question, where am I supposed to place the exclamation point?
I'd like to change field # 5 from "blank" to "not-blank".

Code:
pb_count=`awk -F, 'BEGIN { pb_count=0 } $1 ~ /PBR/ && $5 ~ /^"[ ][ ]*"$/ && $2 ~ /^"N[ ][ ]*"$/ { pb_count++ } END { print pb_count }' ${productionirfe_csv_path}${client_ls}`
NO_IRFE_PB_TRADES=`expr $NO_IRFE_DIRECT_TRADES + $pb_count`

If I'm doing it correctly, I'm supposed to change "~" to "!~". Is this correct?
# 2  
Old 07-06-2005
Quote:
If I'm doing it correctly, I'm supposed to change "~" to "!~". Is this correct?
that's correct
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Centos-quick way to check if static routes are persistent

Hi All, Is there a quick way to check whether the current routes on my centos are persistent or not before rebooting ? i can take a route -n output but i may completely lost access to my server if the routes are gone. thanks. (1 Reply)
Discussion started by: coolatt
1 Replies

2. Shell Programming and Scripting

Help with Check Syntax of Shell Script without Running

Hi Everyone, Is there any way ( generic) to check syntax of Shell Scripts without running it?? (4 Replies)
Discussion started by: roy121
4 Replies

3. Shell Programming and Scripting

Shell script check syntax not working ...

Hello i have question that i want check syntax from my script shell with sh -n filename but it's not show something even i have wrong syntax in my file. why can this happened or any other way to check it? i use on header of file : #!/bin/sh thx before :) (7 Replies)
Discussion started by: Gochengz
7 Replies

4. Shell Programming and Scripting

CHECK SCRIPT SYNTAX

Hi everyone, i'd like someone chechk this script, i know it's very simple but it doesn't work good, let me tell you this script works over huge directories, maybe that's the problem, if somebody can give me other way to develop, or show me where it's the problem, i'll appreciate it. ... (9 Replies)
Discussion started by: Newer
9 Replies

5. UNIX for Advanced & Expert Users

quick remote health check SAP systems from UNIX commandline

Hi folks Howto do quick remote health check for SAP systems on UNIX commandline? To see if a SAP system is down or in maintenace mode (no login). I am searching something like "tnsping"/Oracle for SAP systems. (2 Replies)
Discussion started by: slashdotweenie
2 Replies

6. Shell Programming and Scripting

Quick help on 'awk' needed...!!

bash-2.05$ A=`cat /etc/group |awk -F':' '{if ($1$3$4 ==... (3 Replies)
Discussion started by: ak835
3 Replies

7. UNIX for Dummies Questions & Answers

help with quick syntax error

Here is my script so far, when i run it i get the message: cut: option requires an argument -- 'd' not sure how to solve it. can anyone help? #!/bin/bash for user in $(who | cut -f1 -d'' |sort -u) do echo $(grep $user /etc/passwd |cut -d':' -f5) ... (2 Replies)
Discussion started by: ferrycorsten73
2 Replies

8. Shell Programming and Scripting

How to Check Shell script syntax w/o executing

Hello All, I looking for a way to verify the correction of shell script syntax. Is there any switch like -c in perl which do this in shell ? Thank You. (1 Reply)
Discussion started by: Alalush
1 Replies

9. Shell Programming and Scripting

Help with AWK -- quick question

Ok. I'm just starting to use AWK and I have a question. Here's what I'm trying to do: uname -n returns the following on my box: ftsdt-svsi20.si.sandbox.com I want to pipe this to an AWK statement and make it only print: svsi20 I tried: uname -n | awk '{ FS = "." ; print $1 }' ... (5 Replies)
Discussion started by: Probos
5 Replies

10. UNIX for Dummies Questions & Answers

syntax and semantic check

Does the shell perform a syntax and semantic check before commands are sent to the kernel? Ravioli (3 Replies)
Discussion started by: ravioli
3 Replies
Login or Register to Ask a Question