Skip to content

Instantly share code, notes, and snippets.

@turnipsoup
Created July 4, 2019 06:25
Show Gist options
  • Save turnipsoup/af430becdff4370f9f20d34986019404 to your computer and use it in GitHub Desktop.
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
#!/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