-2

I don't understand how to create a txt to use the calendar utility to display "notes"

closed as unclear what you're asking by countermode, Raphael Ahrens, Stephen Kitt, user34720, Archemar Jan 17 '17 at 12:49

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • echo "test text" > txt will create a file called txt with the contents of test text, but I think your question is more complex than that. There are also a heap of other ways to make a file with text as the content. For example the text editor vi is installed by default in FreeBSD, but how to use vi is another question. – Tigger Jan 17 '17 at 7:55
  • 1
    What should be the content of the desired txt? What have you tried? – Zumo de Vidrio Jan 17 '17 at 8:02
  • 1
    @Zumo I think that's the intent of the question. Looking at the FreeBSD calendar manpage it's not clear at all how one would add notes to a date. – roaima Jan 17 '17 at 12:37
0

To edit a text file, use whatever editor you have available, or install one. nano, emacs, and vi are common ones.

If the calendar utility we're talking about here is the command calendar as described here, then the format of the file is described by the manual.

The file should be called .calendar (with a leading dot) and be placed in your home directory.

  • I figured it was syntax thing, ".calendar" – 19oct3rLP Jan 19 '17 at 12:57
  • Below roaima's example use jan/17 as a format recognized by the "calendar" cmd. hmmmm that's interesting. i wonder if i could change that to a more military format: ddMMMyy example 19JAN17 – 19oct3rLP Jan 19 '17 at 13:01
  • @Hy19r0 You should man calendar, read it to figure out what formats it supports, and then test. – Kusalananda Jan 19 '17 at 13:03
0

The calendar text file is a plain text file with its various date formats described in great detail in the man page.

What's not so clear is how one adds notes to the date formats. Here is a simple example of this. Put the following three lines into the file $HOME/calendar. (Use tab between the date and a note, and at the beginning of a continuation line.)

Jan/17  Answer a couple of questions on unix.stackexchange
        Team meeting first thing
Jan/21  Restart the servers

Now run calendar and if you're doing this on 17th January (any year) you'll get the first two lines. When you run it on 21st January you'll get the third line.

If you run calendar -A3 you'll get today's notes plus those for the next three days (if any).

Not the answer you're looking for? Browse other questions tagged or ask your own question.