07-20-2004
date manipulations
i need a date manipulation unix shell script, to find the difference between any two dates. kindly help me
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All :D
I have a long file having different fields like :-
hh:mm:ss seconds
14:15:56 120
14:18:36 12
15:12:36 1500
I want to subtract the hh:mm:ss in line(2) from hh:mm:ss in line(1) & compare the output of substraction (obtained in... (10 Replies)
Discussion started by: vanand420
10 Replies
2. UNIX for Advanced & Expert Users
hi
i am having a script in which i am supposed to extract data for three different dates...first date is current date
second date is 15 days back
third date is 40 days back
for eg consider todays date 26062006 as first date then
second date is 11062006
third date is 17052006
now in my... (2 Replies)
Discussion started by: rochitsharma
2 Replies
3. Shell Programming and Scripting
Hi,
I have a scenario to just plug out the file name from the following location path.
/opt/project/data/int/holdFiles/csv195687.csv
So, how do I get just file name which is "csv195687.csv" from the above line using awk/shell scripting? Can we use indexOf and Substring in awk to get... (7 Replies)
Discussion started by: anilvvnn
7 Replies
4. Shell Programming and Scripting
Hi All,
I have a pipe delimited file with around 30 fields. What is the simple way to Update a value for any column. For ex. If i want to update 22 field with "album".
Similarly, how to do this for the whole file and selective records of the file.
Example file contents:
... (5 Replies)
Discussion started by: Joe2226
5 Replies
5. Shell Programming and Scripting
Hi Guys...
I do have a script that I need to use time or time function in my condition.
The logic will be like if the current time of execution is between 7am and 7pm then do 1,2,3,etc else do 4,5,6.
I need help is that function or how best can I do this.
Thanks in advance.
Please... (3 Replies)
Discussion started by: Phuti
3 Replies
6. Shell Programming and Scripting
Hello!
I need to realize such task.
1. In my user's home dir I have folder1;
2. In folder1 I have some (various count) subfolders with random names;
3. In these subfolders I have one file anyname.pdf (various name in each subfolder) and file content.txt (constant name in each subfolder)
##... (7 Replies)
Discussion started by: optik77
7 Replies
7. UNIX for Dummies Questions & Answers
Hey guys,
I have a file which contains 22,373 ping trace outputs which I generated using a script I made, see excerpt below:
...
PING6(72=40+8+24 bytes) 2001:630:301:1453:219:e3ff:fee7:8c2a --> 2406:8000:101:c020::24
32 bytes from 2406:8000:101:c020::24, icmp_seq=0 hlim=44 time=279.163 ms... (6 Replies)
Discussion started by: churchill
6 Replies
8. Shell Programming and Scripting
Dear all,
I have 2 questions.
I have a file with many rows which has date of the format YYYYMMDD.
1. I need to change the date to that weeks friday date(Ex: 20120716(monday) to 20120720). Satuday/Sunday has to be changed to next week friday date too.
2. After converting the date to... (10 Replies)
Discussion started by: 2001.arun
10 Replies
9. Shell Programming and Scripting
Hello All,
I have three txt files
***main.txt*****
code test
line code test3
asdfasdf
do for while
line1:
code test
line code test3
asdfasdf
do for while
line2:
code test (6 Replies)
Discussion started by: avatar_007
6 Replies
10. Shell Programming and Scripting
i try to set linux date & time in specific format but it keep giving me error
Example :
date "+%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01"
or
date +"%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01"
keep giving me this error :
date: invalid date ‘19-01-2017 00:05:01'
Please use CODE tags... (7 Replies)
Discussion started by: umen
7 Replies
DP(8) [nmh-1.5] DP(8)
NAME
dp - parse dates 822-style
SYNOPSIS
/usr/lib/mh/dp [-form formatfile] [-format string] [-width columns] [-version] [-help] dates ...
DESCRIPTION
Dp is a program that parses dates according to the ARPA Internet standard. It also understands many non-standard formats, such as those
produced by TOPS-20 sites and some UNIX sites using ctime(3). It is useful for seeing how nmh will interpret a date.
The dp program treats each argument as a single date, and prints the date out in the official 822-format. Hence, it is usually best to
enclose each argument in quotes for the shell.
To override the output format used by dp, the -format string or -format file switches are used. This permits individual fields of the
address to be extracted with ease. The string is simply a format string and the file is simply a format file. See mh-format(5) for the
details.
Here is the default format string used by dp:
%<(nodate{text})error: %{text}%|%(putstr(pretty{text}))%>
which says that if an error was detected, print the error, a `:', and the date in error. Otherwise, output the 822-proper format of the
date.
FILES
$HOME/.mh_profile The user profile
PROFILE COMPONENTS
None
SEE ALSO
ap(8), Standard for the Format of ARPA Internet Text Messages (RFC-822)
DEFAULTS
`-format' default as described above
`-width' default to the width of the terminal
CONTEXT
None
BUGS
The argument to the -format switch must be interpreted as a single token by the shell that invokes dp. Therefore, one must usually place
the argument to this switch inside quotes.
MH.6.8 11 June 2012 DP(8)