Skip to content

Instantly share code, notes, and snippets.

@tomoe-mami
Created March 27, 2013 17:50
Show Gist options
  • Save tomoe-mami/5256510 to your computer and use it in GitHub Desktop.
Save tomoe-mami/5256510 to your computer and use it in GitHub Desktop.
#!/bin/sh
WIDTH=6
HEIGHT=3
CHAR="#"
for FILENAME in $*; do
ABSPATH="$(realpath "$FILENAME")"
echo -ne "\e}it$CHAR$WIDTH;$HEIGHT;$ABSPATH\0"
for (( ROW = 0 ; ROW < $HEIGHT ; ROW++ )); do
echo -ne " \e}ib\0"
for (( COL = 0; COL < $WIDTH ; COL++ )); do
echo -ne "$CHAR"
done
echo -ne "\e}ie\0"
if [ $ROW = 0 ]; then
echo -n " $FILENAME"
fi
echo
done
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment