All Questions
10 questions
8votes
10answers
15kviews
Convert a date from DD-MM-YYYY to YYYY-MM-DD format in bash LINUX
Scenario: I am fetching a date value from a file into a variable and it is in DD-MM-YYYY format by default. I have to substract this date from system date. Subtraction is giving incorrect result if I ...
2votes
2answers
516views
Update any date to the current date in a text file
I have a text file which contains several occurrences of dates. All the dates are written in the format Mon-DD-YYYY. I have to update all these dates in the current date keeping the format Mon-DD-YYYY....
0votes
1answer
182views
Purge lines in a file based on age in shell script
I wanted to record the slave delay in mysql server every minute,so prepared a simple script. #!/bin/bash echo "`date` : `mysql -uroot -pXXXXXX -e"show slave status\G" | grep -i ...
1vote
1answer
61views
Unix script to process data by comparing it to same key records
I have a problem in which Input file has Effective date and End date records. First 6 fields are the keys (12345A). We need to update End date(18 position) based on effective(8 position) date of the ...
-1votes
3answers
127views
insert current date in a place of empty column (field) of a file
I have a file with four columns delimited by "|" as below 23414|test doc for me|| 32322|test doc for you|2004_12_03| 13454|test doc for all||2010_11_01 I am trying to insert the current system date ...
-2votes
1answer
1kviews
Insert today's date at the end of a text file - using bash
I have a text files that is generated through daily running bash script - I want to append a date field into that text file - how can I achieve it ? Name NUM_OF_USERS A------10 B------20 **date-...
1vote
1answer
155views
Calculate difference in numbers and save in colon-separated time format with bash script
I have a tab-separated file, e.g., 0018803 01 1710 2050 002571 0018951 01 1934 2525 003277 0019362 02 2404 2415 002829 0019392 01 2621 2820 001924 0019542 01 ...
6votes
2answers
2kviews
Bash-script. Shift seconds
In bash I don't know how to do that. I need to do a bash-script. At stdin I have .srt file of subtitles in this format: num HH:MM:SS,SSS --> HH:MM:SS,SSS text line 1 text line 2 ... HH:MM:SS,SSS ...
0votes
2answers
183views
How to filter lines with the same date in different formats
I have a txt file like this: ./201709.15.txt:88:word word TAG201709152000 word word ./201709.19.txt:3:word TAG201709152000 word word ./201710.10.txt:5:word word TAG201709152000 word word word and I ...
2votes
1answer
376views
cut slice of file based on time when lines are written
i have a process running always with logging file could reach up to 5 giga, sometime i have to take slice of this log based on interval of time (usually i used dd). is there any command in linux to ...