Last active
November 13, 2023 05:26
-
-
Save xinyangli/71b532da09a3f6f1c0b6d0b7059499cd to your computer and use it in GitHub Desktop.
Generate a markdown file that presents a table grid of all PNG images in the current directory,
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 | |
md_filename="vis.md" | |
cnt=0 | |
echo "| | | | |" >> $md_filename | |
echo "|-|-|-|-|" >> $md_filename | |
for file in $(ls | grep png) | |
do | |
printf "| ![$file](./$file) $file" >> $md_filename; | |
if [ $(($cnt%4)) -eq 3 ]; | |
then | |
printf "|\n" >> $md_filename; | |
fi; | |
let cnt=cnt+1; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment