{"id":2307,"date":"2017-12-08T07:05:47","date_gmt":"2017-12-08T07:05:47","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=2307"},"modified":"2020-01-09T09:50:06","modified_gmt":"2020-01-09T09:50:06","slug":"find-c-file-recursivly-and-copy-to-directory","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/find-c-file-recursivly-and-copy-to-directory\/","title":{"rendered":"Find c file Recursivly and Copy to Directory"},"content":{"rendered":"<p><strong>scmuser created the topic: find c file recursivly and copy to directory<\/strong><\/p>\n<p>Write a shell script to find c file recursivly and copy to one common directory?<\/p>\n<p><strong>rajeshkumar replied the topic: Re: find c file recursivly and copy to directory<\/strong><br \/>\nfollowing program will serve your purpose&#8230;<\/p>\n<p>#!\/bin\/sh<br \/>\ncounter=0<br \/>\nif [ $# -eq 0 ]<br \/>\nthen<\/p>\n<p>for file in `find .\/os -name &#8220;*.c&#8221;`<br \/>\ndo<br \/>\ncp $file \/root\/Release\/Rajesh<br \/>\necho $file<br \/>\ncounter=`expr $counter + 1`<br \/>\ndone<br \/>\nelse<br \/>\necho &#8220;No Argument passed&#8221;<br \/>\nfi<\/p>\n<p>echo &#8220;Number of files found=$counter&#8221;<br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>scmuser created the topic: find c file recursivly and copy to directory Write a shell script to find c file recursivly and copy to one common directory? rajeshkumar replied the&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[454],"tags":[478],"class_list":["post-2307","post","type-post","status-publish","format-standard","hentry","category-shell-script","tag-recursivly"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=2307"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2307\/revisions"}],"predecessor-version":[{"id":2308,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2307\/revisions\/2308"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=2307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=2307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=2307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}