Sponsored Content
Top Forums Shell Programming and Scripting Need help with date arithmetic please Post 303000311 by ektubbe on Sunday 9th of July 2017 01:51:59 PM
Old 07-09-2017
Quote:
Originally Posted by MadeInGermany
Did you replace the day=$((day+1)) by the two lines I gave you?
And do you run your script with bash?
Run it with
Code:
bash -xv ./scriptname ...

and you see what it does.
I tried that, but it didn't work and threw error on the same line I mentioned in the first post Smilie ...will run with -xv option tomorrow n share the logs
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

time arithmetic

Can anyone help please. I am writing a kourne shell script and I am unsure how to do the following: I have extracted a time string from a logfile, and I have another time string I want to compare it to to see if it's later than the time I'm comparing with. i.e. expectedSLA="23:00:00", ... (2 Replies)
Discussion started by: csong2
2 Replies

2. UNIX for Dummies Questions & Answers

arithmetic problem

i am used to making scripts for hp-ux. but lately i tried to make some for solaris. the problem is that when i tried to execute it it gave me an error the "let: not found". why is that? how can i perform an arithmetic function in the solaris shell script? thanks :) (2 Replies)
Discussion started by: inquirer
2 Replies

3. Shell Programming and Scripting

arithmetic in ksh

Helloo.. I am trying one very simple thing I could not find anything on google.. I have 2 integer variable..and I need to do division...in ksh where $catch and $num are integer variable.. I tryed with this: printf "%0.2f" $final=$catch/$num but it does not work.. any help is... (12 Replies)
Discussion started by: amon
12 Replies

4. Shell Programming and Scripting

How to perform arithmetic operation on date

Hi all, I would appreciate if anyone knows how to perform adding to date. As for normal date, i can easily plus with any number. But when it comes to month end say for example 28 Jun, i need to perform a plus with number 3, it will not return 1 Jul. Thanks in advance for your help. (4 Replies)
Discussion started by: agathaeleanor
4 Replies

5. Shell Programming and Scripting

Arithmetic on timestamps

Hi Friends, please advise on shell script to add two time stamps for example : a=12:32 b=12:00 c=a+b=00:32 please help me to find shell script to add to two time stamps, as i need to convert time from EST to GMT or SST to prepare status of jobs in unix and to specify estimated time to... (3 Replies)
Discussion started by: balireddy_77
3 Replies

6. UNIX for Dummies Questions & Answers

Arithmetic: how to??

Hello all, I'd like to know how to perform arithmetic on multiple files. I have got many tab-delimited files. Each file contains about 2000 rows and 2000 columns. What I want to do is to to sum the values in each row & column in every file. The following explains what I want to do; ... (9 Replies)
Discussion started by: Muhammad Rahiz
9 Replies

7. Shell Programming and Scripting

Date and time Arithmetic

Hi, I need to process a file which contains below data. Usually the files contains both Start and Finish time. but for Few records, it contains only Start. For those records I need to add the finish line by adding 5 minutes to Start time. Started BBIDX Tue Jun 1 15:15:11 EDT 2010 292308... (1 Reply)
Discussion started by: siba.s.nayak
1 Replies

8. Post Here to Contact Site Administrators and Moderators

Broken link FAQ date arithmetic with shell

page unix com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html Date Arithmetic with the Shell has link of www samag com/documents/s=8284/sam0307b/0307b.htm which is no longer. Is this the correct place to post this?:confused: and I got message... (1 Reply)
Discussion started by: dgerman
1 Replies

9. Shell Programming and Scripting

Help needed with some date arithmetic

I have a file (main.lst) containing a list of dates in DDMMYYYY format. The dates will mostly be the same but it is possible to have multiple dates and these need not be in chronological order. I have another file containing another list of dates (holidays.lst). The task is to get the latest... (5 Replies)
Discussion started by: elixir_sinari
5 Replies

10. Shell Programming and Scripting

Arithmetic with bash

I need to divide the number of white spaces by total number of characters in a file using bash. I am able to get the number of white spaces correctly using: tr -cd < afile | wc -c I am also able to get the total number of characters using: wc -c afile How do I divide the first... (2 Replies)
Discussion started by: ngabrani
2 Replies
calendar(1)						      General Commands Manual						       calendar(1)

Name
       calendar - calendar reminder service

Syntax
       calendar [-]

Description
       The  command  consults the file `calendar' in the current directory and prints out lines that contain today's or tomorrow's date.  The com-
       mand recognizes most month-day dates, such as Dec. 7, december 7, 12/7, but it does not recognize dates formatted in the following ways:  7
       December  or  7/12.  If you give the month as * with a date, such as, * 1, that day in any month will do.  On weekends, specifying tomorrow
       extends through Monday.

       When an argument is present, the command searches through a user's calendar file in his login directory and sends him any positive  results
       by Normally this is done daily under control of

       The  calendar  file  is	first  run  through  the  C  preprocessor, to include any other calendar files specified with the #include syntax.
       Included calendars are shared by all users, and are maintained and documented by the local administration.

Options
       -    Functions for every user who has a calendar file in his login directory.

Restrictions
       The extended idea of tomorrow does not account for holidays.

Files
       calendar
       /usr/lib/calendar to figure out today's and tomorrow's dates
       /etc/passwd
       /tmp/cal*
       /lib/cpp, egrep, sed, mail as subprocesses

See Also
       at(1), cron(8), mail(1)

																       calendar(1)
All times are GMT -4. The time now is 07:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy