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 topic: Re: find c file recursivly and copy to directory
following program will serve your purpose…
#!/bin/sh
counter=0
if [ $# -eq 0 ]
then
for file in `find ./os -name “*.c”`
do
cp $file /root/Release/Rajesh
echo $file
counter=`expr $counter + 1`
done
else
echo “No Argument passed”
fi
echo “Number of files found=$counter”
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn
Latest posts by Rajesh Kumar (see all)
- Best AI tools for Software Engineers - November 4, 2024
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024