473,396 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Awk script runs, no error, no output

I have simple awk scripts which copies information from one file based on the conditions satisfied and pastes to another. When I execute this script, no eeor is invoked, it just runs without doing anything and when I abort it using ctrl D, it executes END loop and prints Done on the terminal. What is wrong with my script. Any suggestion/advice.

Thank you.
Deepa
Expand|Select|Wrap|Line Numbers
  1. #!/bin/awk -f
  2. BEGIN {
  3. f1="all_CopyM.txt";
  4. f2= "all_domega.txt";
  5. }
  6. {
  7. if ($1 == "A" || "T" && $6 == "ASN" || $6 == "GLN" || $6 == "PRO" || $6 == "THR" || $6 == "SER" || $6 == "CYS"){
  8.     print $0 f1 > f2 ;
  9.     }
  10. }
  11.  
  12. END {
  13.     print "Done";
  14. }
  15.  
Mar 26 '10 #1
2 2095
numberwhun
3,509 Expert Mod 2GB
I don't know if its just me, but I don't see where you are setting up variables $1 and $6. You defined f1 and f2 and did an if statement. There is nothing to lead up to the if statement for it to go on. The program did exactly as it was told.

Regards,

Jeff
Mar 28 '10 #2
rski
700 Expert 512MB
You didn't see the source file but i think the if statement should be
Expand|Select|Wrap|Line Numbers
  1. if ((($1 == "A")||($1== "T")) && ($6 == "ASN" || $6 == "GLN" || $6 == "PRO" || $6 == "THR" || $6 == "SER" || $6 == "CYS")){
  2.  
Apr 6 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Seagull Manager | last post by:
Running Apache 1.3, PHP 4.3, and WinXP, configured acc. to instructions on apache manual and php manual (as far as I can see), but getting "internal server error" in browser... log says "Premature...
2
by: mark.richards | last post by:
At first I thought this error had to do with a timeout problem, but now I am almost certain it has direct bearing on the size of the data that I am posting. I am using a simple form: <?php...
8
by: Sticks | last post by:
ok... im not quite sure how to describe my problem. i have a php script that runs through my entire php site and writes the resulting output to html files. this is necessary as the nature of the...
16
by: Chuck Amadi | last post by:
Sorry to bovver you again (again) here's script. I still can't see why the get_payload() doesn't produce the plain text message body of an emails in the testwwws users mailbox. As you can see I...
6
by: bojanraic | last post by:
Hi! I recently started playing with Python CGI, and I was happy that my basic input-name--print-hello-name CGI form example worked, so I thought I should advance to somew\hat more complicated...
13
by: Patrick | last post by:
I understand that with IIS5.1 on Windows XP Professional SP1, I can 1) Either set under IIS Manager-> Any specific Virtual Directory-> Configuration->Options->ASP Script timeout for all pages...
2
by: Flinky Wisty Pomm | last post by:
Okay, I'm pretty baffled by this one. I've got a page in a popup which takes a postcode; looks up a list of addresses for that postcode; then uses a callback to get the details for a specific...
8
by: flit | last post by:
Hello All, I am trying to get information from a form and send it to a python script without success.. Here is my objective: User enters data in form --form send variables to python script...
13
by: wattersmt | last post by:
Hello, I am trying to write a python cgi that calls a script over ssh, the problem is the script takes a very long time to execute so Apache makes the CGI time out and I never see any output. ...
4
by: brad | last post by:
When I use idle or a shell to execute a python script, the script executes in the directory it is currently in (in this case, my desktop). However, when using GNOME and right clicking the py script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.