Sponsored Content
Full Discussion: Read file name based on date
Contact Us Post Here to Contact Site Administrators and Moderators Read file name based on date Post 302979744 by RudiC on Thursday 18th of August 2016 11:48:41 AM
Old 08-18-2016
Some comments (not necessarily in severity order or order of appearance):
- consider refraining from using variables named close to PATH (essential system variable for your session; used to locate commands!) so you don't mess up your session by accident.
- your first ACTION_TIME assignment has a syntax error in the date command.
- giving variables (date) identical names to commands may lead to confusion.
- what do you create the date variable for in the first place?
- consider using the recommended $(...) notation in lieu of the deprecated `...` for "command substitution".
- your find command won't find any of the files quoted in post#1 as the pattern in SUFFIX_ARG doesn't match.
- the test for existence is for a different file than the one actually copied, so probably pointless.

On top, the specification in post#1 is sparse by itself, and it is not improved by your second post. Why don't you take a step back, start over, and present your problem in a decent, precise, detailed way supported by samples?

Last edited by RudiC; 08-18-2016 at 01:43 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read file based on condition

Hi Friends, Can any one help with this: I have a huge file with the format as A SAM 4637 B DEPT1 4758 MILAN A SMITH 46585 B DEPT2 5385 HARRYIS B SAMUL 63547 GEORGE B DANIEL 899 BOISE A FRES 736 74638 I have to read this file and write only the records that starts with "B" only ... (5 Replies)
Discussion started by: sbasetty
5 Replies

2. Shell Programming and Scripting

Read a date value from other file.

My Situation is I have to read a date value from previuosly created file and need to increment the date in the newly created file. I need unix scripting for the above condtion. Thanx in advance. (3 Replies)
Discussion started by: chilli_taste
3 Replies

3. Shell Programming and Scripting

Split the file based on date value

Hi frnds, I have flat file as . Say : output-file1.txt Output-file2.txt (1 Reply)
Discussion started by: Gopal_Engg
1 Replies

4. UNIX for Dummies Questions & Answers

Truncating file based on date

Hi, I need to truncate a file based on date.Suppose i have a log file which is getting updated every date,i need to keep 7 days worth of data(like sysdate-7) and rest i want to truncate it.Can some help me? (5 Replies)
Discussion started by: Param0073
5 Replies

5. Shell Programming and Scripting

creating a file name based on date

I need to automate a weekly process of piping a directory list to a csv file. Normally I do ls -l > files_04182010.csv (04182010 being the date..) Can someome show me how I would script this, so that when the script is ran it grabs the current date and formats it and allows me to use that... (8 Replies)
Discussion started by: jeffs42885
8 Replies

6. Shell Programming and Scripting

Help with ksh-to read ip file & append lines to another file based on pattern match

Hi, I need help with this- input.txt : L B white X Y white A B brown M Y black Read this input file and if 3rd column is "white", then add specific lines to another file insert.txt. If 3rd column is brown, add different set of lines to insert.txt, and so on. For example, the given... (6 Replies)
Discussion started by: prashob123
6 Replies

7. Shell Programming and Scripting

Script to determine Date,TotalFile,total size of file based on date

I have file listed like below -rw-r--r--+ 1 test test 17M Nov 26 14:43 test1.gz -rw-r--r--+ 1 test test 0 Nov 26 14:44 test2.gz -rw-r--r--+ 1 test test 0 Nov 27 10:41 test3.gz -rw-r--r--+ 1 test test 244K Nov 27 10:41 test4.gz -rw-r--r--+ 1 test test 17M Nov 27 10:41 test5.gz I... (5 Replies)
Discussion started by: krish2014
5 Replies

8. HP-UX

HP/UX command to pull file name/date based on date

HI, Can anyone tell me how to pull the date and file name separated by a space using the find command or any other command. I want to look through several directories and based on a date timeframe (find -mtime -7), output the file name (without the path) and the date(in format mmddyyyy) to a... (2 Replies)
Discussion started by: lnemitz
2 Replies

9. Shell Programming and Scripting

To take file based on date passed

Hi Guys, I have certain files in my directory which gets appended with dates something like this T1_aug17.txt T1_Aug17.txt T1_Sep17.txt config.txt T1 T2 my code: curr_date=`date -d "$date" +%Y-%m-%d` path=mydir for file in `cat config.txt` do final_file=$(ls $path/ | grep -i... (12 Replies)
Discussion started by: rohit_shinez
12 Replies

10. UNIX for Beginners Questions & Answers

Read a file and send mail based on grep

Hi All, I am having a job and I need to send email when the job is running. On any other case (success,fail) I don't needed to send email. I check with BMC they told they dont have that in the version I am using. So I created a dependent job and grepped for the status and sent email. My... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
doctools::cvs(n)						Documentation tools						  doctools::cvs(n)

__________________________________________________________________________________________________________________________________________________

NAME
doctools::cvs - Processing text in 'cvs log' format SYNOPSIS
package require Tcl 8.2 package require textutil package require doctools::cvs ?1? ::doctools::cvs::scanLog text evar cvar fvar ::doctools::cvs::toChangeLog evar cvar fvar _________________________________________________________________ DESCRIPTION
This package provides Tcl commands for the processing and reformatting text in the format generated by the cvs log command. The commands ::doctools::cvs::scanLog and ::doctools::cvs::toChangeLog are derived from code found on the Tcl'ers Wiki [http://wiki.tcl.tk]. See the references at the end of the page. API
::doctools::cvs::scanLog text evar cvar fvar The command takes the text and parses it under the assumption that it contains a CVS log as generated by cvs log. The resulting information is stored in the variables whose names were specified via evar, cvar, and fvar. Already existing information in the referenced variables is preserved, allowing the caller to merge data from multiple logs into one database. varname evar (in) Has to refer to a scalar variable. After the call this variable will contain a list of all the entries found in the log file. An entry is identified through the combination of date and author, and can be split over multiple physical entries, one per touched file. It should be noted that the entries are listed in the same order as they were found in the text. This is not necessarily sorted by date or author. Each item in the list is a list containing two elements, the date of the entry, and its author, in this order. The date is formatted as year/month/day. varname cvar (in) Has to refer to an array variable. Keys are strings containing the date and author of log entries, in this order, separated by a comma. The values are lists of comments made for the entry. varname fvar (in) Has to refer to an array variable. Keys are strings containing date, author of a log entry, and a comment for that entry, in this order, separated by commas. The values are lists of the files the entry is touching. ::doctools::cvs::toChangeLog evar cvar fvar ] The three arguments for this command are the same as the last three arguments of the command ::doctools::cvs::scanLog. This com- mand however expects them to be filled with information about one or more logs. It takes this information and converts it into a text in the format of a ChangeLog as accepted and generated by emacs. The constructed text is returned as the result of the command. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category doctools of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
http://wiki.tcl.tk/log2changelog KEYWORDS
changelog, cvs, cvs log, emacs, log CATEGORY
Documentation tools COPYRIGHT
Copyright (c) 2003-2008 Andreas Kupries <andreas_kupries@users.sourceforge.net> doctools 1 doctools::cvs(n)
All times are GMT -4. The time now is 05:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy