Skip to content

Instantly share code, notes, and snippets.

@brandonstephens
Last active December 12, 2015 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonstephens/4725792 to your computer and use it in GitHub Desktop.
Save brandonstephens/4725792 to your computer and use it in GitHub Desktop.
Bash function that concatenates all txt files with filename into a single txt file.
# place this in your aliases or bash profile
# cd to the directory of .txt files and run the command 'melt'
function melt(){
FILE=_meltOutput.txt
rm -f $FILE
for f in *.txt
do
printf "$f - " | cat >> $FILE
cat $f | cat >> $FILE
echo >> $FILE
done
open $FILE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment