The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Replace Junk chars (Sed) alfredo123 Shell Programming and Scripting 4 02-27-2008 03:38 PM
Using SED to get n chars after given value from file Kally UNIX for Dummies Questions & Answers 12 12-19-2007 01:54 AM
cut last 4 chars pbsrinivas Shell Programming and Scripting 5 06-28-2007 09:14 PM
replace chars, Jairaj Shell Programming and Scripting 7 02-28-2007 02:34 AM
Awk- catching the last two chars Gerry405 UNIX for Dummies Questions & Answers 9 11-22-2005 02:23 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-26-2007
Registered User
 

Join Date: Oct 2005
Posts: 85
How to convert C source from 8bit chars to 16bit chars?

I was using the following bash command inside the emacs compile command to search C++ source code:

grep -inr --include='*.h' --include='*.cpp' '"' * | sed "/include/d" | sed "/_T/d" | sed '/^ *\/\//d' | sed '/extern/d'

Emacs will then position me in the correct file and at the correct line number so I can edit it appropriate.

I want to locate all the string literals in my source code of the form "xyz" and convert them to invoke a macro so they look like this: _T("xyz") where _T is a macro.

The problem with the above grep and sed commands is that it locates quotes inside the slash-star star-slash comments. How can I write a script that does not match inside /* and */?

Thanks,
siegfried
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:24 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0