Convert certain file types within all subdirectories with dos2unix
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have thousands of files I need convert to Linux standard line ending format, i.e. using dos2unix
.
The files to convert have extension either .cpp
or .h
The files in question are structured in subdirectories.
I know I could find all files all with:
find ./ -follow -type f ( -iname *.cpp -o -iname *.h )
But how do I apply the command to them?
I suppose with a simple bash
script with some for
cycle, which I fail to write.
shell-script
add a comment |Â
up vote
0
down vote
favorite
I have thousands of files I need convert to Linux standard line ending format, i.e. using dos2unix
.
The files to convert have extension either .cpp
or .h
The files in question are structured in subdirectories.
I know I could find all files all with:
find ./ -follow -type f ( -iname *.cpp -o -iname *.h )
But how do I apply the command to them?
I suppose with a simple bash
script with some for
cycle, which I fail to write.
shell-script
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have thousands of files I need convert to Linux standard line ending format, i.e. using dos2unix
.
The files to convert have extension either .cpp
or .h
The files in question are structured in subdirectories.
I know I could find all files all with:
find ./ -follow -type f ( -iname *.cpp -o -iname *.h )
But how do I apply the command to them?
I suppose with a simple bash
script with some for
cycle, which I fail to write.
shell-script
I have thousands of files I need convert to Linux standard line ending format, i.e. using dos2unix
.
The files to convert have extension either .cpp
or .h
The files in question are structured in subdirectories.
I know I could find all files all with:
find ./ -follow -type f ( -iname *.cpp -o -iname *.h )
But how do I apply the command to them?
I suppose with a simple bash
script with some for
cycle, which I fail to write.
shell-script
asked Nov 6 '17 at 4:38
Vlastimil
6,4711147120
6,4711147120
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
just use.
find . -type f ( -iname "*.cpp" -o -iname "*.h" ) -exec dos2unix +
+
instead of;
that's a new feature to me - and one less reason to prefer xargs.
â Jasen
Nov 6 '17 at 9:14
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
just use.
find . -type f ( -iname "*.cpp" -o -iname "*.h" ) -exec dos2unix +
+
instead of;
that's a new feature to me - and one less reason to prefer xargs.
â Jasen
Nov 6 '17 at 9:14
add a comment |Â
up vote
2
down vote
accepted
just use.
find . -type f ( -iname "*.cpp" -o -iname "*.h" ) -exec dos2unix +
+
instead of;
that's a new feature to me - and one less reason to prefer xargs.
â Jasen
Nov 6 '17 at 9:14
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
just use.
find . -type f ( -iname "*.cpp" -o -iname "*.h" ) -exec dos2unix +
just use.
find . -type f ( -iname "*.cpp" -o -iname "*.h" ) -exec dos2unix +
answered Nov 6 '17 at 4:44
ñÃÂsýù÷
15.5k92563
15.5k92563
+
instead of;
that's a new feature to me - and one less reason to prefer xargs.
â Jasen
Nov 6 '17 at 9:14
add a comment |Â
+
instead of;
that's a new feature to me - and one less reason to prefer xargs.
â Jasen
Nov 6 '17 at 9:14
+
instead of ;
that's a new feature to me - and one less reason to prefer xargs.â Jasen
Nov 6 '17 at 9:14
+
instead of ;
that's a new feature to me - and one less reason to prefer xargs.â Jasen
Nov 6 '17 at 9:14
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f402762%2fconvert-certain-file-types-within-all-subdirectories-with-dos2unix%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password