All,
I currently have a requirement to fetch a Date value from a table. And then insert a Header record into a file along with that date value.
ex: echo "HDR"" "`date +%Y%j` `date +%Y%m%d`
In the above example I used julian date and standard date using Current Date. But the requirement here is to use a Date value fetched from a database table.
Kindly help me please.
Hi all,
I have used a bash script which ultimately converts a string into date using date --date option:
Code:
DATE=$DATE" "$TIME" "`date +%Y` //concatenating 2 strings
TMRW_DATE=`date --date="$DATE" +"%s"` //applying date command on string and getting the unixtime
Moderator's Comments:
Hi,
I'm trying to get the name of a file that has the current date in the name.
The filename is on the form A<current date>01.DC, for example A2012110501.DC
I have this script so far
Code:
date +%y%m%d
D=$(date +%y%m%d)
N=A20$D
echo $N
N2={$N}01.DC
echo $N2
And gets the following output
Quote:
A20121105
}01.DC1105
When I try to a
I have this simple script which redirects the output and append it to a file.
filename="/home/ronnie/tmp/hello"
date=$(date)
echo "$date" >> $filename
Now, lets suppose I change date=$(date) to date= $(date) which will generate an error.
Hi All,
I have a quick question with regards to SED syntax, and I hope someone here can help me out.
I have some text based reports in which I would like to strip the "Current Date" from and replace with equivalent number of empty spaces, for every occurrence.
For example, here is what I need to strip:
Hi All,
I have a quick question with regards to SED syntax, and I hope someone here can help me out.
I have some text based reports in which I would like to strip the "Current Date" from and replace with equivalent number of empty spaces, for every occurrence.
For example, here is what I need to strip:
Hi,
I need subtract two date values (which are in day of the year format) and the output would give the remaining days. using the command date +"%j" i would get today's 'day of the year' i.e.,
Code:
> date +"%j"
256
Next, i need to take input of a previous date in the format 09/05/2012 and then convert it to 'day of the year format'.
I need a script to search for *.LOG in a directory, output the line after the current date and yesterday's date and also output the next 5 lines after the current date and yesterday's date
I have tried following commands, still no result
Code:
Currentdate=`date -u +"%m/%d/%y"`
awk '/$Currentdate/{getline; print}' *.LOG
The log has data for the whole month for which I need only the
I'm looking for a way to have the "date" command output the date in a specific format.
I'm not familiar with the different ways to use the date command at all.