Results 1 to 10 of 12
Hi, i was wondering how i can use the cal command so it displays the current month and the next month, i know you can use cal -3 9 2007 ...
- 03-08-2011 #1Just Joined!
- Join Date
- Mar 2011
- Posts
- 4
Help with bash
Hi, i was wondering how i can use the cal command so it displays the current month and the next month, i know you can use cal -3 9 2007 to show the previous current and next but i just want to display the current and next. Thanks a lot!
- 03-09-2011 #2
From the man page: cal -A 1
-A number
Display the number of months after the current month.
- 03-09-2011 #3Just Joined!
- Join Date
- Mar 2011
- Posts
- 4
I may be being stupid but when i type cal -A 2 it says that A is an invalid option, any ideas why?
- 03-09-2011 #4Just Joined!
- Join Date
- Mar 2007
- Location
- Bogotá, Colombia
- Posts
- 39
Well, maybe it's because it's the wrong option, if you look at the manual you can find this:
Code:-m month Display the specified month. If month is specified as a decimal number, it may be followed by the letter ‘f’ or ‘p’ to indicate the following or preceding month of that number, respectively.
- 03-10-2011 #5
"cal -A 1" gives me a calendar of two months, the current month and the next month. I have no idea why you would get an error. It should work. What distro are you running? Perhaps it's different for some distros.
- 03-10-2011 #6Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,117
Hi.
The command cal on GNU/Debian testing (wheezy) accepts "-A". The command cal on GNU/Debian squeeze (stable) does not. Both man pages are marked March 14, 2009; the wheezy version describes "-A", the squeeze version does not.
So, even within a specific distribution there are some differences between editions.
Best wishes ... cheers, drlWelcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )
- 03-10-2011 #7Just Joined!
- Join Date
- Mar 2011
- Posts
- 4
I am currently using ubuntu, i thought maybe i could write a bash script and then execute it with ./filename in the terminal, does anyone have any ideas on what the bash scrip would contain, i tried simply writing cal 1 2010 + cal 2 2010 but this didnt work. Thank you
- 03-10-2011 #8Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,117
Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )
- 03-10-2011 #9Just Joined!
- Join Date
- Mar 2011
- Posts
- 4
Thanks for the help, really appreciate it. Do you know any free e books where i can expand my knowledge?
- 03-10-2011 #10Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,117
Hi.
Many people recommend these two, and you can Google for more ... cheers, drl
Bash Guide for Beginners
Advanced Bash-Scripting GuideWelcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )


Reply With Quote
