Created
July 4, 2019 06:25
-
-
Save turnipsoup/af430becdff4370f9f20d34986019404 to your computer and use it in GitHub Desktop.
Create pipe delineated output file of all .log files in a directory, including file name on each line
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/bash | |
# | |
for filename in ./*.log; do | |
while read line; do | |
echo "$filename|$line" >> output.txt | |
done < ./$filename | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment