Last active
August 9, 2020 15:26
-
-
Save joepol/3e0fc14fea3e2a1b6c5f00db1d3038f7 to your computer and use it in GitHub Desktop.
Bash script to run all files in a directory redirect output to text file
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 | |
echo "Run all files in dir, redirect outputs to text files" | |
echo " " | |
for file in DIRECTORY/* | |
do | |
filename=`basename $file` | |
echo "Currently runing $filename" | |
"$file" >> output_$filename.txt | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
musn't be same of the script (recursion...)
Replace it with your full path directory