Skip to content

Instantly share code, notes, and snippets.

@nak3
Last active December 22, 2015 12:48
Show Gist options
  • Save nak3/6474449 to your computer and use it in GitHub Desktop.
Save nak3/6474449 to your computer and use it in GitHub Desktop.
#!/bin/sh
# file name
AllFileInOneFile="allfileinonefile.xxx"
test -e ${AllFileInOneFile} && rm ${AllFileInOneFile}
echo "--- file list ---" >> ${AllFileInOneFile}
find . -type f -name '*.cpp' -or -name '*.hpp' >> ${AllFileInOneFile}
echo "----------------" >> ${AllFileInOneFile}
for filepath in `find . -type f -name '*.cpp' -or -name '*.hpp'`
do
if [ ${filepath} = "$0" ]
then
continue
fi
echo "================================================== " >> ${AllFileInOneFile}
echo ${filepath} >> ${AllFileInOneFile}
echo "================================================== " >> ${AllFileInOneFile}
echo " " >> ${AllFileInOneFile}
cat ${filepath} >> ${AllFileInOneFile}
echo " " >> ${AllFileInOneFile}
echo " --- END ${filepath}" --- >> ${AllFileInOneFile}
echo " " >> ${AllFileInOneFile}
done
echo "Complete ... Please Enter or some key"
read wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment