Sponsored Content
Full Discussion: Find and Create by Date
Top Forums UNIX for Dummies Questions & Answers Find and Create by Date Post 302227823 by ravzter on Friday 22nd of August 2008 04:18:05 AM
Old 08-22-2008
Excellent it works!

I've modified the whole script, but I'm not getting the final result.

bash-3.00$ CURRENT_DATE=`date "+%Y%m%d"`
bash-3.00$ echo "$CURRENT_DATE"
20080822
bash-3.00$ OLD1=`date "+%d"`
bash-3.00$ OLD2=`expr $OLD1 - 1`
bash-3.00$ OLD_ONE=`date "+%Y%m"`$OLD2
bash-3.00$ echo"$OLD_DATE"

bash-3.00$

Is possible to ouput the shortname version of the month? Like Jan, Feb, Aug.

Thanks!

Last edited by ravzter; 08-22-2008 at 05:32 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to find Previous date and Coming date

Hi All, How to find a date which is 7 days from the current date as well as how to find a date which is 7 days before this current date. Urgently i need help. Thanks in Advance Regards Arunava (2 Replies)
Discussion started by: arunava_maity
2 Replies

2. UNIX for Dummies Questions & Answers

Directory create date

Hi, How do you find the create date of a directory? I can see the modification date using ls -l but I'm looking for the create date. Many thanks Helen (2 Replies)
Discussion started by: Bab00shka
2 Replies

3. Shell Programming and Scripting

Need help to create a date script

So I need to create a shell script that can take as input a numeric day, month and year and output the day of the week for the input date. So let's say, I input "programname 19 10 2006" it should output Thursday... I tried messing around with the grep and awk commands, but I can't get it to... (6 Replies)
Discussion started by: mredwardlee
6 Replies

4. UNIX for Advanced & Expert Users

date issue-find prevoius date in a patricular format

Hi , I have written a shell script that takes the current date on the server and stores it in a file. echo get /usr/home/data-`date '+%Y%d'`.xml> /usr/local/sandeep/GetFILE.ini I call this GetFILE.ini file from an sftp program to fetch a file from /usr/home/ as location. The file is in... (3 Replies)
Discussion started by: bsandeep_80
3 Replies

5. Shell Programming and Scripting

How to find a date which is 7 days past when given current date

hii all. I have to get the date of the 7th day past from the current date. if i give the current date as sep 3 then i must get the date as 27th of august. can we get the values from the "cal" command. cal | awk '{print $2}' will this type of command work. actually my need is if today is... (17 Replies)
Discussion started by: ladtony
17 Replies

6. Shell Programming and Scripting

How to find the create time of a file if current date is in next month

Hi All, I want to find the time diffrence between currnt time and "abc.txt" file create time. I have solve that but if the abc.txt file created last month then is there any process to find the difftent? Exp: Create time of abc.txt is "Apr 14 06:48" and currect date is "May 17 23:47".... (1 Reply)
Discussion started by: priyankak
1 Replies

7. Shell Programming and Scripting

How to create variable from date

I have a requirement to send a trigger file (trigger_dayn.dat) to a remote server through the FTP trigger_dayn.dat - here the dayn is the day number. However the dayn is not sysdate. day 1 is from Monday 07:00.00 AM to Tuesday 06:59:59 AM and so on. So if the trigger file is generated say... (1 Reply)
Discussion started by: k_vikash
1 Replies

8. Shell Programming and Scripting

Find week of the year for given date using date command inside awk

Hi all, Need an urgent help on the below scenario. script: awk -F"," 'BEGIN { #some variable assignment} { #some calculation and put values in array} END { year=#getting it from array and assume this will be 2014 month=#getting it from array and this will be 05 date=#... (7 Replies)
Discussion started by: vijaidhas
7 Replies

9. UNIX for Dummies Questions & Answers

Find the count of files by last created date based on the given date range

My unix version is IBM AIX Version 6.1 I tried google my requirement and found the below answer, find . -newermt “2012-06-15 08:13" ! -newermt “2012-06-15 18:20" But newer command is not working in AIX version 6.1 unix I have given my requirement below: Input: atr files: ... (1 Reply)
Discussion started by: yuvaa27
1 Replies

10. Shell Programming and Scripting

Replacing Date in the file with Create date and timestamp

Hello, I have files that with a naming convention as shown below. Some of the files have dates in the file name and some of them don't have dates in the file name. imap-hp-import-20150917.txt imap-dell-gec-import-20150901.txt imap-cvs-import-20150915.txt imap-gec-import.txt... (8 Replies)
Discussion started by: Saanvi1
8 Replies
nl_langinfo(3int)														 nl_langinfo(3int)

Name
       nl_langinfo - language information

Syntax
       #include <nl_types.h>
       #include <langinfo.h>

       char *nl_langinfo (item)
       nl_item item;

Description
       The  function  returns a pointer to a null-terminated string containing information relevant to a particular language or cultural area. The
       language is identified by the last successful call to the appropriate category.	The categories are shown in the following  table  and  are
       defined in

       For  instance,  the following example would return a pointer to the string representing the abbreviated name for the first day of the week,
       as defined by category
       nl_langinfo (ABDAY_1);

       If the category has not been called successfully, data for a supported language is not available, or is not defined, then returns a pointer
       to an empty (null) string.  In the C locale, the return value is the American English string defined in the following table:

       -----------------------------------------------------------------------
       Identifier   Meaning			    C locale	  Category
       -----------------------------------------------------------------------
       NOSTR	    Negative response		    no		  LC_ALL
       YESSTR	    Positive response		    yes 	  LC_ALL
       D_T_FMT	    Default date and time format    %a %b %d
						    %H:%M:%S %Y   LC_TIME
       D_FMT	    Default date format 	    %m/%d/%y	  LC_TIME
       T_FMT	    Default time format 	    %h:%m:%s	  LC_TIME

       DAY_1	    Day name			    Sunday	  LC_TIME
       DAY_2	    Day name			    Monday	  LC_TIME
       ....	    ....			    ....	  ....
       DAY_7	    Day name			    Saturday	  LC_TIME

       ABDAY_1	    Abbreviated day name	    Sun 	  LC_TIME
       ABDAY_2	    Abbreviated day name	    Mon 	  LC_TIME
       ABDAY_3	    Abbreviated day name	    Tue 	  LC_TIME
       ....	    ....			    ....	  ....
       ABDAY_7	    Abbreviated day name	    Sat 	  LC_TIME

       MON_1	    Month name			    January	  LC_TIME
       MON_2	    Month name			    February	  LC_TIME
       MON_3	    Month name			    March	  LC_TIME
       ....	    ....			    ....	  ....
       MON_12	    Month name			    December	  LC_TIME

       ABMON_1	    Abbreviated month name	    Jan 	  LC_TIME
       ABMON_2	    Abbreviated month name	    Feb 	  LC_TIME
       ....	    ....			    ....	  ....
       ABMON_12     Abbreviated month name	    Dec 	  LC_TIME

       RADIXCHAR    Radix character		    .		  LC_NUMERIC
       THOUSEP	    Thousands separator 			  LC_NUMERIC
       CRNCYSTR     Currency format				  LC_MONETARY
       AM_STR	    String for AM		    AM		  LC_TIME
       PM_STR	    String for PM		    PM		  LC_TIME
       EXPL_STR     Lower case exponent character   e		  LC_NUMERIC

       EXPU_STR     Upper case exponent character   E		  LC_NUMERIC
       -----------------------------------------------------------------------

See Also
       intro(3int), ic(1int), setlocale(3int), environ(5int), nl_types(5int)
       Guide to Developing International Software

																 nl_langinfo(3int)
All times are GMT -4. The time now is 07:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy