Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: learner24
2,216
Posted By learner24
Shell Scripting Date manipulation
Hi Experts,

i have date as inputdate=01/01/2013,how to get the previous date from this date and also first day's date of the month.

example:

inputdate=01/06/2013

previousdate=31/05/2013
...
1,315
Posted By learner24
Hi Experts, #!/usr/bin/ksh date =...
Hi Experts,

#!/usr/bin/ksh

date = 16/07/2013

datestamp=$date '+%d/%m/%Y'
yest=$((datestamp -1))
echo $previous_day

i am getting error, how can i get the pervious days date based on the...
1,315
Posted By learner24
Hi Experts, I tired this. #!/bin/ksh ...
Hi Experts,

I tired this.

#!/bin/ksh

inputdate=15/07/2013

year=`expr substr $inputdate 7 4`
month=`expr substr $inputdate 4 2`

FROM_DATE=01/$month/$year
echo $month
echo $year
echo...
1,353
Posted By learner24
How to find the date of previous day in shell script?
Hi Experts,

i am using the below code get the date of previous day.

#!/usr/bin/ksh

datestamp=`date '+%Y%m%d'`
yest=$((datestamp -1))
echo $yest

When i execute the code i am getting...
1,315
Posted By learner24
Hi Experts, can i store this value in...
Hi Experts,

can i store this value in variable like.

inputdate=12/06/2013

date= echo "inputdate" | awk -F"/" '{print "01"FS$2FS$3}'

echo $date

output: Expected
01/06/2013

regards,
1,315
Posted By learner24
Hi Experts, Thanks, this is working for...
Hi Experts,

Thanks, this is working for current month, if we pass a different date like 12/06/2013, will this work?

how can we modify the code to take any date and get the first day of that...
1,315
Posted By learner24
Hi Experts, GNU date is not supporting in my...
Hi Experts,

GNU date is not supporting in my UNIX prompt, so based on today's date how can i get the first day' of the month. i want the first date of the month.

for example:

if current date...
1,315
Posted By learner24
Hi Experts, I want to use in unix script. ...
Hi Experts,

I want to use in unix script.

any help/suggestions

regards,
1,315
Posted By learner24
Hi Experts, when i run the command in unix...
Hi Experts,

when i run the command in unix prompt: i got the below error:

date -d "-1 day" +%d/%m/%Y
date: illegal option -- d
Usage: date [-u] [+format]
date [-u] [mmddhhmm[[cc]yy]]...
1,315
Posted By learner24
Help on Dates in Shell Scripting
Hi Experts,

I am using the below code to get the previous day based on the date given as a input.

#!/usr/bin/ksh

datestamp=`date '+%Y%m%d'`
yest=$((datestamp -1))
echo $yest

Output:...
Showing results 1 to 10 of 10

 

Featured Tech Videos

All times are GMT -4. The time now is 09:52 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy