Skip to content

Instantly share code, notes, and snippets.

@z3ntu
Last active November 5, 2015 11:29
Show Gist options
  • Save z3ntu/3fe5e983964b4d82c72a to your computer and use it in GitHub Desktop.
Save z3ntu/3fe5e983964b4d82c72a to your computer and use it in GitHub Desktop.
Bash script for TINF, PLEASE edit yours!
#!/bin/bash
#
# 3EHIF, Luca Weiss, 2015-11-05
#
read -p "Please enter the title: " title
echo "Please now enter lines, finish with entering ---"
p_part=""
while true; do
read -p "> " new
if [ "$new" == "---" ]; then
break
fi
new_part="<p>$new</p>"
p_part="$p_part$new_part"
done
echo "<html><head><title>$title</title></head><body><h1>$title</h1>$p_part</body></html>" > $1
firefox $1 > /dev/null &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment