LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 05-19-2009, 02:17 PM   #1
antiregulator
LQ Newbie
 
Registered: Apr 2009
Posts: 13

Rep: Reputation: 0
truct keyword...


hi there...

as i was wandering in the world of linux kernel headers, i stumbled on a type-name-like-thing with the name truct.

one example follows...

Code:
truct modversion_info
    unsigned long crc;
    char name[MODULE_NAME_LEN];
;
does anyone know anything more or should i just grep it until i find its definition!?

thx ppl!
dave.
 
Old 05-20-2009, 07:58 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
Unless someone declared an alias (or whatever C calls it), it's a typo. Should be "struct".
 
Old 05-20-2009, 08:01 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,448

Rep: Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069
Something is trimming column 1 off your data (or your display). I'd lay a small wager it should look like
Code:
struct modversion_info
{
    unsigned long crc;
    char name[MODULE_NAME_LEN];
};
 
Old 05-20-2009, 03:22 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
Quote:
Originally Posted by syg00 View Post
Something is trimming column 1 off your data (or your display). I'd lay a small wager it should look like
Code:
struct modversion_info
{
    unsigned long crc;
    char name[MODULE_NAME_LEN];
};
bingo!! That's the answer.
 
Old 05-21-2009, 09:17 AM   #5
antiregulator
LQ Newbie
 
Registered: Apr 2009
Posts: 13

Original Poster
Rep: Reputation: 0
well, it kinda crossed my mind, but, on the same file all edge charachters are present!

#includes <...> are not deprived of a #, and as you can see, the semicolons line up properly!
 
Old 05-21-2009, 09:26 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
Does it matter what program you use to read the file?

What happens if you do this?:

grep -A4 "truct modversion" filename
 
Old 05-21-2009, 09:31 AM   #7
antiregulator
LQ Newbie
 
Registered: Apr 2009
Posts: 13

Original Poster
Rep: Reputation: 0
just try the next command...
Code:
/usr/src/linux/include/linux/grep -o truct ./*|sort|most
and see how widesperad is the use of truct!
 
Old 05-21-2009, 09:38 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,448

Rep: Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069
Instead of -o, try word bounding ...
 
Old 05-21-2009, 09:53 AM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
Quote:
Originally Posted by antiregulator View Post
just try the next command...
Code:
/usr/src/linux/include/linux/grep -o truct ./*|sort|most
and see how widesperad is the use of truct!
how is that syntax supposed to work?? Here, it tries to run "grep" in that path and of course cannot find it.

But, why are you asking us to run commands? You need to figure what's happening on your machine......
 
Old 05-21-2009, 10:18 AM   #10
antiregulator
LQ Newbie
 
Registered: Apr 2009
Posts: 13

Original Poster
Rep: Reputation: 0
i did not force anyone to run any command at anytime m8!

and what is happening to my computer, possibly happens to yours as well!

and i am trully sorry for making a mistake in my command syntax. what i meant was
Code:
/usr/src/linux/include/linux/# grep -o truct ./*|sort|most
 
Old 05-22-2009, 09:20 AM   #11
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
bingo!! that does make more sense.....

"grep -o" returns only the search string, so what you are seeing is quite normal. It will find every line containing "truct" and print out only the "truct". It will do this for every line containing "struct".

syg00 has the right answer (word bounding)

I also asked if you had the same issue when using different programs to read the files.......
 
  


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
Linux classes [:keyword:] Hi_This_is_Dev Linux - Newbie 6 05-15-2009 09:23 AM
how to grep a "keyword" beside another keyword? xiawinter Linux - Software 7 12-29-2007 01:50 AM
Keyword Harvester / Java? Mega Man X Programming 2 06-21-2007 09:31 AM
c++ super keyword kuna Programming 4 01-04-2005 08:22 PM
cvs keyword sustitution blackzone Programming 1 08-08-2004 10:47 AM


All times are GMT -5. The time now is 05:03 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration