You are not logged in.

#1 2010-04-10 10:21:24

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

[Solved] CLI Calendar

Where to find this calendar?

http://www.computerhope.com/unix/ucalande.htm

I had it on ubuntu, and liked it, used it to show me the "today appointment" in conky. Anyone knows where is it? Or some light alternative? smile

Last edited by archman-cro (2010-07-09 23:40:41)

Offline

#2 2010-04-10 10:43:12

xenofungus
Member
From: Spain
Registered: 2009-10-17
Posts: 63

Re: [Solved] CLI Calendar

No idea, but it looks very similar to remind, which is in community.

Offline

#3 2010-04-10 10:43:53

dcc24
Member
Registered: 2009-10-31
Posts: 732

Re: [Solved] CLI Calendar

It is in the util-linux-ng package. The command is cal.

Edit: Oh, I now see that's probably not what you were asking for. Sorry.

Last edited by dcc24 (2010-04-10 10:45:13)


It is better to keep your mouth shut and be thought a fool than to open it and remove all doubt. (Mark Twain)

My AUR packages

Offline

#4 2010-04-10 10:47:47

Vamp898
Member
From: 東京
Registered: 2009-01-03
Posts: 934
Website

Re: [Solved] CLI Calendar

cal displays a calendar^^

Offline

#5 2010-04-10 11:23:47

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [Solved] CLI Calendar

I know, guys, but i want some calendar which will output a message only (from a file) for today (example, for April 10th)

I used to do "calendar -l 0 -f <file with dates>" and it'd echo the line which corresponds with the date.
Example:

user@arch ~]$ calendar -l 0 -f dates.txt
You need to go climbing today.

Any ideas?

Thanks for the replies, btw. smile

Last edited by archman-cro (2010-04-10 11:28:20)

Offline

#6 2010-04-10 12:00:42

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [Solved] CLI Calendar

You may have a look at "pal" from extra. Citing from "man pal":

       pal  is  a command‐line calendar utility.  It displays a cal(1)‐like calender
       and events specified in text files.

OPTIONS
       The following options are provided by pal:

       -d date
              Show events on the given date.  Valid formats for  date  include:  dd,
              mmdd,  yyyymmdd,  'yesterday',  'today', 'tomorrow', 'n days away', 'n
              days ago', first two letters of weekday, 'next ' followed by first two
              letters  of weekday, 'last ' followed by first two letters of weekday,
              '1 Jan 2000', 'Jan 1 2000'.

( . . . )

       Event Files
          Event  files  are  ASCII  or UTF-8 text files (usually with a .pal ending)
          that define events for pal to show.  Example event files can be  found  in
          /usr/share/pal.   The  first  line  in  these files indicate settings that
          apply to all of the events in the file.  The first line  starts  with  two
          characters  that  should  be  used  in  the calendar that pal displays.  A
          longer description of the kinds of events in  the  file  follows  the  two
          characters.   This  description  will be displayed when the -r argument is
          used.  All other lines in the file are in the  format  date  event.   date
          defines  when  the  event  occurs and event is a string that describes the
          event.

Last edited by bernarcher (2010-04-10 12:03:59)


To know or not to know ...
... the questions remain forever.

Offline

#7 2010-04-10 12:40:29

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [Solved] CLI Calendar

berbarcher, I've tried it, it gives to many output. I practically want it to display my appointment like with a "cat" command, nothing more.

Anyone knows where can I find this "calendar" thing? :S

Offline

#8 2010-04-10 12:56:40

dcc24
Member
Registered: 2009-10-31
Posts: 732

Re: [Solved] CLI Calendar

Does apt have a functionality similar to "pacman -Qo" that shows the owner of a package? If so, you can see which package it belongs to with "<some apt command> $(which calendar)"


It is better to keep your mouth shut and be thought a fool than to open it and remove all doubt. (Mark Twain)

My AUR packages

Offline

#9 2010-04-10 12:56:58

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [Solved] CLI Calendar

grep "$(date '+%b %d')" dates.txt
Apr 10: Go climbing.

Offline

#10 2010-04-10 13:26:08

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [Solved] CLI Calendar

Offline

#11 2010-04-10 16:26:28

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [Solved] CLI Calendar

Procyon wrote:

grep "$(date '+%b %d')" dates.txt
Apr 10: Go climbing.

Wow , thanks, man! That's it. smile That's one of the things why I wanna learn bash properly. smile

So the command goes like this for me:

grep "$(date '+%d %m')" <path_to_file>

@ dcc24: I don't use ubuntu anymore since I've switched to Arch. Thanks, anyway!

@ thisoldman: thanks! smile

Last edited by archman-cro (2010-04-10 16:30:47)

Offline

#12 2010-04-11 10:02:25

muunleit
Member
From: Germany
Registered: 2008-02-23
Posts: 234

Re: [Solved] CLI Calendar

Calcurse from community maybe interesting, too.


"The mind can make a heaven out of hell or a hell out of heaven" -- John Milton

Offline

#13 2010-04-11 11:02:57

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [Solved] CLI Calendar

@ muunleit, tried it, but removed it, cause "date" does the job. Thanks anyway! smile

Offline

#14 2010-04-24 23:25:25

harryNID
Member
From: P3X-1971
Registered: 2009-06-12
Posts: 117

Re: [Solved] CLI Calendar

How about the best of both worlds.  Just make sure to structure your date command to match whatever date you have in your file so grep can find it. Also I chose "grep -F" to save you 1/1000000th of a second processor time cause every bit helps! smile

A slightly prettier version of the same command.

clear && cal && printf "%s\n\n" "$(grep -F "$(date '+%b %d')" dates.txt)"

Output:

       April 2010     
Su Mo Tu We Th Fr Sa
             1  2  3
4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30

Apr 24 Have Fun!

[07:02 PM harry@ ~]$

The "clear &&" is for making it stand-out in the terminal. For other uses you might want to drop it.


In solving a problem of this sort, the grand thing is to be able to reason backward. That is a very useful accomplishment, and a very easy one, but people do not practice it much. In the everyday affairs of life it is more useful to reason forward, and so the other comes to be neglected. There are fifty who can reason synthetically for one who can reason analytically.  --Sherlock Holmes

Offline

#15 2010-07-09 23:40:11

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [Solved] CLI Calendar

@harryNID: Sorry, I didn't see your reply. It looks awesome. Thanks! smile

Offline

#16 2010-07-11 03:57:20

harryNID
Member
From: P3X-1971
Registered: 2009-06-12
Posts: 117

Re: [Solved] CLI Calendar

My pleasure.:D

That's my way of learning BASH. I search for little problems like this and try to figure them out. To tell you the truth I had forgot about this post too. I just happened back here while looking through the forum.


In solving a problem of this sort, the grand thing is to be able to reason backward. That is a very useful accomplishment, and a very easy one, but people do not practice it much. In the everyday affairs of life it is more useful to reason forward, and so the other comes to be neglected. There are fifty who can reason synthetically for one who can reason analytically.  --Sherlock Holmes

Offline

Board footer

Powered by FluxBB