Search Results

Search: Posts Made By: SiftinDotCom
3,229
Posted By SiftinDotCom
How to append copyright to all files?
I have one file that contain copyright notice, that I would like to append to all files in our directory structure (excluding binaries). How can I do that? Thanks for your help!
37,617
Posted By SiftinDotCom
Thanks era. Good tips and Great help. One...
Thanks era. Good tips and Great help.

One more twist, say
if A exists(non-null) don't move B, just remove it.

Logic:
if A = "";
than
move B before {
else
delete B

Reason for doing...
37,617
Posted By SiftinDotCom
perl -0777 -pe...
perl -0777 -pe 's/struct(\s*\{.*?\})\s*(\S*);/struct \2\1;/sg' $file worked only for strtuct leaving enum intact
37,617
Posted By SiftinDotCom
Good Morning ERA, Your perl magic works fine....
Good Morning ERA,
Your perl magic works fine. It needs a bit of tweaking in my actual test case
perl -0777 -pe 's/(\s*\{.*?\})\s*(\S*);/\2\1;/sg'

Also, irrespective of
struct A{
...
}B;
or...
37,617
Posted By SiftinDotCom
Thats right. I have to check before and after...
Thats right.
I have to check before and after the { } and combine A and B (and leave rest of stuff the file intact)

Thanks a lot for your perl script, it works! I will try to make it work with...
37,617
Posted By SiftinDotCom
era, thanks for these scripts. Sorry about the...
era, thanks for these scripts.
Sorry about the confusing first comment.
I was tryingto get output pattern
struct AB {
Blah1
Blah2
Blah3
...
};

and in this process I was unable to extract...
37,617
Posted By SiftinDotCom
Thanks era, but I am not seeing expected output...
Thanks era, but I am not seeing expected output using perl command

$ perl -0777 -pe 's/\A[^\{]*\{//s; s/\}.*?\{/\n/sg; s/\}[^\}]*\Z//s' test

Blah1
Blah2
Blah3
...


So it looks like that...
37,617
Posted By SiftinDotCom
Multiple line match using sed
Please help!

Input pattern, where ... could be any number of lines
struct A {
Blah1
Blah2
Blah3
...
} B;

output pattern
struct AB {
Blah1
Blah2
Blah3
...
};

I need help in...
3,053
Posted By SiftinDotCom
Thanks a lot for your input and code. As I see...
Thanks a lot for your input and code. As I see following two inputs

Input pattern is
^.*struct $1 { multi-line structure } $2;

Output is
ABC_DataDesc_T $1/$2_desc { multi-line structure };
...
3,053
Posted By SiftinDotCom
flexible sed command needed to handle multiple input types
Hello, I need a smart sed command that can take any of the following two as an input and give below mentioned output. As you can see, I am trying to convert some C code

INPUT:
struct abc_sample1...
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 06:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy