Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Add parameter in UNIX from date Post 303005025 by Nileshta on Thursday 12th of October 2017 04:37:57 AM
Old 10-12-2017
Hi
I have written below code
now is is adding one more file and printing 4 file names
Code:
echo "$XXCU_DATA_TOP/AP/in/123"
cd $XXCU_DATA_TOP/AP/in/000723

touch  201708010000 startfile
find . -type f -print -maxdepth 1 | sed -e 's;[^/]*/;|____;g;s;____|; |;g' #> $dd1

Output:
Code:
AA
BB
CC
201708010000

Moderator's Comments:
Mod Comment Please use CODE tags correctly as required by forum rules!

Last edited by RudiC; 10-12-2017 at 06:06 AM.. Reason: Corrected CODE tags, and moved thread from "How-to-post-in-the-the-unix-and-linux-forums"
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing Date as parameter with sh script

Hi I need to pass a date argument with my shell script. Can any one send me code for the same. eg For 15th Aug 2006. Iwant to pass parameter like this ./startenv.sh 08/15/2006. Everyday date argument must change. Will the below code work ? ./startenv.sh date '+%m/%d/%y' THanks... (1 Reply)
Discussion started by: pankajkrmishra
1 Replies

2. Shell Programming and Scripting

passing date parameter in cronjob

Hi All, I have a crontab entry for every 5 min running. 5 * * * * /tmp/scripts/ksh/CsVues_H.sh `date +%Y%m%d_%H` >> /tmp/scripts/ksh/Cronresult.log and I am passing the date parameter. ( `date +%Y%m%d_%H` ) But the parameter values which i am expecting inside the script is... (6 Replies)
Discussion started by: scorpio
6 Replies

3. Shell Programming and Scripting

Shell script with date parameter

Hi All I have a shell script which calls all the Teradata Utiltyes . There is a sudden change in the requirment . What i'm asked to do is pass on the DATE to the shell script which should take the date automatically and run the utilityes. i.e. the date should not be passed on... (5 Replies)
Discussion started by: vinayrao
5 Replies

4. Shell Programming and Scripting

Incrementing the date depending on the Counter (parameter) passed to the script

Hello Everyone, I have been trying to complete a shell script where, I need to increment the date depending on the file (depending on the date) availability on the remote server. i.e. Basically, I will be passing a counter (like parameter 1 or 2 or 3 or 4). First I will check for the... (1 Reply)
Discussion started by: filter
1 Replies

5. UNIX and Linux Applications

Passing date parameter on Kshell command line

I need to execute a .ksh from command line. The ksh calls a control file and has 3 parameters. First parameter is a csv file, second the target table in oracle and third parameter is a date parameter. I am attempting the below from the ksh command line {code} => testfile.ksh filname.csv... (1 Reply)
Discussion started by: kobe24
1 Replies

6. Shell Programming and Scripting

help with date parameter

I have a file with timestamp in the file name FILE=DETAIL_20120419141952_CODE.txt I am using the below expression to derive the file name FILE=DETAIL_$(date +'%Y%m%d')*_CODE.txt echo gives me correct filename but when I call it as a paramter to another script its being taken as. ... (3 Replies)
Discussion started by: dsravan
3 Replies

7. Shell Programming and Scripting

Parameter file with changing date

Hi, I have a trigger file which looks like this abcdefgh_YYYYMMDD.trg The YYYYMMDD is the year, month and the date. So for example today the trigger file would be abcdefgh_20130703.trg similarly tomorrow it would be abcdefgh_20130704.trg I need to write a script to check if the trigger file... (2 Replies)
Discussion started by: halfafringe
2 Replies

8. Shell Programming and Scripting

Last date of month based on parameter

Hi All, How do i get the last date of a month in Unix based on a parameter value. My requirement is if i pass 03/05/2014 as parameter, then i shud get the output/return value as 2/28/2014 If i pass 03/31/2014 as parameter, the output/return value should be 03/31/2014 itself. Also,... (2 Replies)
Discussion started by: galaxy_rocky
2 Replies

9. Shell Programming and Scripting

Pass date (YYYY-MM-DD) as parameter and get Day

Hi, I have a requirement where I have to pass Date to a script and get the day from it. Ex If parameter is 2015-09-29 The output should be Tuesday. Can you please tell me how to get that? (6 Replies)
Discussion started by: ashwin3086
6 Replies

10. UNIX for Beginners Questions & Answers

How to replace a parameter(variable) date value inside a text files daily with current date?

Hello All, we what we call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below: abc.txt ------------------ line1 line2 line3 $$EDWS_DATE_INSERT=08-27-2019 line4 $$EDWS_PREV_DATE_INSERT=08-26-2019 I am trying to... (1 Reply)
Discussion started by: pradeepp
1 Replies
HTML::CalendarMonth::DateTool(3pm)			User Contributed Perl Documentation			HTML::CalendarMonth::DateTool(3pm)

NAME
HTML::CalendarMonth::DateTool - Base class for determining which date package to use for calendrical calculations. SYNOPSIS
my $date_tool = HTML::CalendarMonth::DateTool->new( year => $YYYY_year, month => $one_thru_12_month, weeknum => $weeknum_mode, historic => $historic_mode, datetool => $specific_datetool_if_desired, ); DESCRIPTION
This module attempts to utilize the best date calculation package available on the current system. For most contemporary dates this usually ends up being the internal Time::Local package of perl. For more exotic dates, or when week number of the years are desired, other methods are attempted including DateTime, Date::Calc, Date::Manip, and the linux/unix 'ncal' or 'cal' commands. Each of these has a specific subclass of this module offering the same utility methods needed by HTML::CalendarMonth. METHODS
new() Constructor. Takes the following parameters: year Year of calendar in question (required). If you are rendering exotic dates (i.e. dates outside of 1970 to 2038) then something besides Time::Local will be used for calendrical calculations. month Month of calendar in question (required). 1 through 12. weeknum Optional. When specified, will limit class excursions to those that are currently set up for week of year calculations. historic Optional. If the the ncal or cal commands are available, use one of them rather than other available date modules since these utilities accurately handle some specific historical artifacts such as the transition from Julian to Gregorian. datetool Optional. Mostly for debugging, this option can be used to indicate a specific HTML::CalendarMonth::DateTool subclass for instantiation. The value can be either the actual utility class, e.g., Date::Calc, or the name of the CalendarMonth handler leaf class, e.g. DateCalc. Use 'ncal' or 'cal', respectively, for the wrappers around those commands. There are number of methods automatically available: month() year() weeknum() historical() datetool() Accessors for the parameters provided to "new()" above. dow1st() Returns the day of week number for the 1st of the "year" and "month" specified during the call to "new()". Relies on the presence of "dow1st_and_lastday()". Should be 0..6 starting with Sun. lastday() Returns the last day of the month for the "year" and "month" specified during the call to "new()". Relies on the presence of "dow1st_and_lastday()". Overridden methods Subclasses of this module must provide at least the "day_epoch()" and "dow1st_and_lastday()" methods. dow1st_and_lastday() Required. Provides a list containing the day of the week of the first day of the month (0..6 starting with Sun) along with the last day of the month. day_epoch() Optional unless interested in epoch values for wacky dates. For a given day, and optionally "month" and "year" if they are different from those specified in "new()", provide the unix epoch in seconds for that day at midnight. If the subclass is expected to provide week of year numbers, three more methods are necessary: dow() For a given day, and optionally "month" and "year" if they are different from those specified in "new()", provide the day of week number. (1=Sunday, 7=Saturday). add_days($days, $delta, $day, [$month], [$year]) For a given day, and optionally "month" and "year" if they are different from those specified in "new()", provide a list of year, month, and day once "delta" days have been added. week_of_year($day, [$month], [$year]) For a given day, and optionally "month" and "year" if they are different from those specified in "new()", provide a list with the week number of the year along with the year. (some days of a particular year can end up belonging to the prior or following years). AUTHOR
Matthew P. Sisk, <sisk@mojotoad.com> COPYRIGHT
Copyright (c) 2010 Matthew P. Sisk. All rights reserved. All wrongs revenged. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
HTML::CalendarMonth(3), Time::Local(3), DateTime(3), Date::Calc(3), Date::Manip(3), cal(1) perl v5.12.4 2011-08-26 HTML::CalendarMonth::DateTool(3pm)
All times are GMT -4. The time now is 02:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy