Skip to content

Instantly share code, notes, and snippets.

@fortunto2
Created May 26, 2018 20:12
Show Gist options
  • Save fortunto2/dcd07882b2b0a413993b1815d6e49c3e to your computer and use it in GitHub Desktop.
Save fortunto2/dcd07882b2b0a413993b1815d6e49c3e to your computer and use it in GitHub Desktop.
Скрипт для печати текста в консоль, удобно для вставления рекурсивно из папки всех файлов в Word
#!/bin/bash
#argument extention
FEXT=$1
if [ $# -eq 0 ]
then
echo "No arguments, example: py"
exit 0
fi
#print tree
tree ./*.$FEXT
#comand find
CF=`find -name \*.$FEXT -type f`
#loop to convert multiple files
for i in $CF; do
printf '%s\n' '******************************'
printf '%s\n' $i
printf '%s\n' '******************************'
printf '%s\n'
cat $i
printf '%s\n'
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment