LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-20-2011, 06:31 AM   #16
aicaicai
Member
 
Registered: Aug 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled

NO,I working on ubuntu 11.04
 
Old 09-20-2011, 10:30 PM   #17
kakaka
Member
 
Registered: Sep 2003
Posts: 382

Rep: Reputation: 87
Hi aicaicai,

Rather than uploading your awk program as an attachment to your post on linuxquestions.org you put your awk program in your question. So I copied your awk program text by selecting it with my mouse, and pasting it into an editor in Linux.

Some things that check for errors in programming languages don't count comments when they give line numbers in which errors occur. So if line 1 is a comment, with line 2 the first line of code, if there is an error in line 2, they might report an error in line 1.

I practically don't notice it anymore. If I'm given the type of error and pointed to a line near the line in which I made the error, I can usually find my mistake.

But when you mentioned that awk was complaining about line 1 in what I sent you, I double checked. The awk I'm using with Linux doesn't ignore comments when counting line numbers for errors. In the awk you are using with Linux, Line 1 in the program you sent, probably is the first comment line.

There are various so called "character sets" for use in text files. In an awk program I normally only use characters from the US-ASCII character set.

In principle, you have to be using a different character set, because the characters in the comments in the awk program you showed us, don't exist in the US-ASCII character set.

But the editor I often use with Linux, by default allows for character set UTF-8, even though I normally don't make use of the extra character codes that UTF-8 allows.

As a result of all that, when I sent you changes to your original program, the character codes in the comments may have been different than they originally were.

The character code that awk mentioned in the error message, 0xff is the highest value that will fit in a single byte. That seemingly made the probability very high, that the issue was a character set problem.

That's why I suggested you remove the comments and see if you still got the error message.

Last edited by kakaka; 09-20-2011 at 10:39 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting columns from multiple files with awk orcaja Linux - Newbie 7 02-14-2012 10:24 PM
extracting columns with awk gav251 Programming 7 03-10-2011 08:40 AM
[SOLVED] Extracting auditing info using awk system and ausearch BlackCrowe Programming 6 09-02-2010 01:51 AM
AWK/Perl for extracting data from txt file to numerous other files briana.paige Linux - Newbie 2 05-05-2009 09:53 AM
Extracting text with grep or awk? UrbanDruid Linux - Newbie 5 04-07-2005 02:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration