I am trying to include the standard C package stdint.h
to files which have the word LARGE_INTEGER
, as a part of conversion from Windows to Linux drivers as discussed here for datatypes.
I know the previous threads about find and xargs, here and here.
Code where GNU find part is based mainly on this thread:
gfind /tmp/ -type f \
\( -name "*.h" -o -name "*.cpp" \) \
-exec ggrep -Pl "LARGE_INTEGER" {} +
and its pseudocode extension where I want also that the files must contain the word LARGE_INTEGER
gfind /tmp/ -type f \
\( -name "*.h" -o -name "*.cpp" \) \
-and -exec ggrep -Pl "LARGE_INTEGER" {} \; \
| xargs gsed -i '1s/^/#include <stdint.h>\n/'
where I am uncertain about -and
and giving
gsed: can't read /tmp/: No such file or directory
...
I followed examples in commandlinefu here.
How can you combine a new command to the find based on GNU SED?
-size -5k
is time-saver because I have had files which size is >200 Mb as binary data. Why do you use-print
in codes 2-3? I do not find it intuitive. – Léo Léopold Hertz 준영 Jun 30 '15 at 19:36