Created
May 26, 2018 20:12
-
-
Save fortunto2/dcd07882b2b0a413993b1815d6e49c3e to your computer and use it in GitHub Desktop.
Скрипт для печати текста в консоль, удобно для вставления рекурсивно из папки всех файлов в Word
This file contains hidden or 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/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