Last active
December 15, 2015 09:19
-
-
Save vejuhust/5237330 to your computer and use it in GitHub Desktop.
print all c code in this folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TARGETFILE=allinone.c | |
if [ -e "$TARGETFILE" ]; then | |
rm -f "$TARGETFILE" | |
fi | |
if [ -n "$1" ]; then | |
printf "$1""\n" >> "$TARGETFILE" | |
fi | |
printf "%s\n\n" $(pwd) >> "$TARGETFILE" | |
for filename in $(ls | sort) | |
do | |
if [ "$0" != ./$filename ] && [ "$TARGETFILE" != $filename ]; then | |
printf "******** %s BEGIN ********\n" $filename >> "$TARGETFILE" | |
cat $filename >> "$TARGETFILE" | |
printf "******** %s END ********\n\n\n\n" $filename >> "$TARGETFILE" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment