------------------------------------------------------------
Technology/Gopher Formatting, (sdf.org), 07/06/2018
------------------------------------------------------------
I told myself I wouldn't care. I tried to convince myself
that it was OK not to have a header. I went without one for
so long. I thought that I could do it. I was wrong.
Here's the thing: I have several phlogs, and I want to write
about different things on each one. For my own sanity, and
possibly for anyone who stumbles upon my phlogs, I want to
keep track of what is going on. It's nice to have gophermaps
and directories and other sundry ways of tracking what a
file should have in it, but a header keeps it all in once
neat little place, for anyone and everyone to quickly and
easily identify.
"But it's too much work," I said to myself. Copying those
characters in from some other post, or maybe having a text
file to start from. Ok, fine. It is too much work. As stupid
as that sounds, it was an extra step that I didn't want to
deal with.
Wait a minute... an extra step that I don't want to deal
with that is pretty much the same work every time. That
sounds like a candidate for a script.
So I cobbled together an ill-conceived little script to help
me have headers on my phlog posts. It looks like this:
--------------------
#!/usr/pkg/bin/bash
if [ $# -eq 0 ]
then
echo "Please provide a filename."
exit 1
fi
text_file=$1
printf '%.s-' {1..60} > ${text_file}
printf "\n, (%s), %s\n" "$(hostname)" "$(date '+%m/%d/%Y')"
>> ${text_file}
printf '%.s-' {1..60} >> ${text_file}
printf "\n" >> ${text_file}
nano -r60 ${text_file}
-----------------------
Nothing fancy, just a couple "lines" and the text that I
want, with the current date. The very, very astute reader
will note that it is the same header that I decided on after
a whole lot of musing[1].
Bottom line, I suppose, is that I want a header, I'm too
lazy to type one or even copy one in, so I have a little
script to help me get started. Now I can have my cake and
eat it too.
[1]
gopher://circumlunar.space:70/0/~tfurrows/phlog/ajz_postHeaders.txt