Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help in script to check file name with todays date Post 302831903 by Yoda on Friday 12th of July 2013 08:35:01 AM
Old 07-12-2013
Use parameter substitution to extract specific part of file name and then compare.

Assuming file name is stored in variable: file
Code:
f_dt="${file#*.}"
f_dt="${f_dt%-*}"

s_dt="$( date +%Y%m%d )"

if [ "$f_dt" = "$s_dt" ]
then
        # Action if true
else
        # Action if false
fi

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

file date check script

I am creating a KSH script and need to check the filedate against the system date. I can get the sys date w. date command, and I was able to get the filedate w. the awk command but when I compare them w. an if condition statement I get syntax error. Not sure what's wrong, and other suggestions on... (4 Replies)
Discussion started by: jaxconsultant
4 Replies

2. UNIX for Dummies Questions & Answers

Get yesterdays date given todays date

Hi Guys. I am very new to UNIX. I need to get yesterdays and tommorows date given todays date. Which command and syntax do i use in basic UNIX shell. Thanks. (2 Replies)
Discussion started by: magikminox
2 Replies

3. Linux

Comparing the file drop date with todays date

Daily one file will dropped into this directory. Directory: /opt/app/jt/drop File name: XXXX_<timestamp>.dat.gz I need to write a script which checks whether the file is dropped daily or not. Any idea in the script how can we compare timestamp of the file to today's date?? (3 Replies)
Discussion started by: Rajneel
3 Replies

4. Shell Programming and Scripting

Shell script help to eliminate files of todays date

Hi I am very new to shell scripting and have written a script (below). However the directory I am searching will contain a file with a .trn extension each day which I want to eliminate. Each day the file extension overnight will change to trx, if this fails I want to know. Basically what I... (2 Replies)
Discussion started by: richM
2 Replies

5. Shell Programming and Scripting

Perl Script to check file date and size

Hi guys, i am new to perl. I started reading the perl documents and try to come up with some logic. I am trying to create a script that would go into a location, search for todays files, then searches for all .txt files from today. If todays not found, its an error If file size is less... (26 Replies)
Discussion started by: DallasT
26 Replies

6. Shell Programming and Scripting

Perl Script to execute todays date.

Hi Folks, I have created a script last month to retrive files thru FTP and cronjob was running fine till yesterday. But the naming convention of the daily file is Filename_<date>.xml where date is YYYYMMDD. But today i have received file name as Filename_20110232.xml :( Part of my Perl... (4 Replies)
Discussion started by: Sendhil.Kumaran
4 Replies

7. Shell Programming and Scripting

Script to check file with previous date

Hi all,I need your help to create the script.I need a script to check the ZIP file at network location with yesterday date name. ZIP file creation date is current date, but name of the zip file is previous date. for example file name "20110216.zip" created today 201102017.I just want to return the... (1 Reply)
Discussion started by: deepaksingla
1 Replies

8. Shell Programming and Scripting

Need help in Shell Script comparing todays date with Yesterday date from Sysdate

Hi, I want to compare today's date(DDMMYYYY) with yesterday(DDMMYYYY) from system date,if (today month = yesterday month) then execute alter query else do nothing. The above requirement i want in Shell script(KSH)... Can any one please help me? Double post, continued here. (0 Replies)
Discussion started by: kumarmsk1331
0 Replies

9. Shell Programming and Scripting

Shell script to compare two files of todays date and yesterday's date

hi all, How to compare two files whether they are same are not...? like i had my input files as 20141201_file.txt and 20141130_file2.txt how to compare the above files based on date .. like todays file and yesterdays file...? (4 Replies)
Discussion started by: hemanthsaikumar
4 Replies

10. Shell Programming and Scripting

Shell script to check current date file is created and with >0 kb or not for multiple directories

Hi All, I am new in scripting and working in a project where we have RSyslog servers over CentOS v7 and more than 200 network devices are sending logs to each RSyslog servers. For each network devices individual folders create on the name of the each network devices IP addresses.The main... (7 Replies)
Discussion started by: Pinaki
7 Replies
native::Wc(3)						User Contributed Perl Documentation					     native::Wc(3)

NAME
SVN::Wc - Subversion working copy functions SYNOPSIS
Incomplete OBJECTS
svn_wc_status_t $wcstat->entry() A svn_wc_entry_t object for the item. Can be undef if not under version control. $wcstat->text_status() An integer representing the status of the item's text. Can be one of the $SVN::Wc::Status::* constants. $wcstat->prop_status() An integer representing the status of the item's properties. Can be one of the $SVN::Wc::Status::* constants. $wcstat->locked() A boolean telling if the item is locked. A directory can be locked if a working copy update was interrupted. $wcstat->copied() A boolean telling if the item was copied. A file or directory can be copied if it's scheduled for addition-with-history (or part of a subtree that is scheduled as such). $wcstat->switched() A boolean telling if the item was switched. A file or directory can be switched if the switch command has been used. $wcstat->repos_text_status() An integer representing the status of the item's text in the repository. Can be one of the $SVN::Wc::Status::* constants. $wcstat->repos_prop_status() An integer representing the status of the item's properties in the repository. Can be one of the $SVN::Wc::Status::* constants. svn_wc_entry_t $wcent->name() Entry's name. $wcent->revision() Base revision. $wcent->url() URL in repository. $wcent->repos() Canonical repository URL. $wcent->uuid() Repository uuid. $wcent->kind() The kind of node. One of the following constants: $SVN::Node::none, $SVN::Node::file, $SVN::Node::dir, $SVN::Node::unknown. $wcent->schedule() Scheduling. One of the SVN::Wc::Schedule::* constants. $wcent->copied() In a copied state. $wcent->deleted() Deleted, but parent rev lags behind. $wcent->absent() Absent -- we know an entry of this name exists, but that's all (usually this happens because of authz restrictions) $wcent->incomplete() For THIS_DIR entry, implies whole entries file is incomplete. $wcent->copyfrom_url() Copyfrom location. $wcent->copyfrom_rev() Copyfrom revision. $wcent->conflict_old() Old version of conflicted file. $wcent->conflict_new() New version of conflicted file. $wcent->conflict_wrk() Working version of conflicted file. $wcent->prejfile() Property reject file. $wcent->text_time() Last up-to-date time for text contents (0 means no information available). $wcent->prop_time() Last up-to-date time for properties (0 means no information available). $wcent->checksum() Base-64 encoded checksum for the untranslated text base file, can be undef for backwards compatibility. $wcent->cmt_rev() Last revision this was changed. $wcent->cmt_date() Last date this was changed. $wcent->cmt_author() Last commit author of this item. CONSTANTS
SVN::Wc::Notify::Action $SVN::Wc::Notify::Action::add Adding a path to revision control. $SVN::Wc::Notify::Action::copy Copying a versioned path. $SVN::Wc::Notify::Action::delete Deleting a versioned path. $SVN::Wc::Notify::Action::restore Restoring a missing path from the pristine text-base. $SVN::Wc::Notify::Action::revert Reverting a modified path. $SVN::Wc::Notify::Action::failed_revert A revert operation has failed. $SVN::Wc::Notify::Action::resolved Resolving a conflict. $SVN::Wc::Notify::Action::skip Skipping a path. $SVN::Wc::Notify::Action::update_delete Got a delete in an update. $SVN::Wc::Notify::Action::update_add Got an add in an update. $SVN::Wc::Notify::Action::update_update Got any other action in an update. $SVN::Wc::Notify::Action::update_completed The last notification in an update (including updates of externals). $SVN::Wc::Notify::Action::update_external Updating an external module. $SVN::Wc::Notify::Action::status_completed The last notification in a status (including status on externals). $SVN::Wc::Notify::Action::status_external Running status on an external module. $SVN::Wc::Notify::Action::commit_modified Committing a modification. $SVN::Wc::Notify::Action::commit_added Committing an addition. $SVN::Wc::Notify::Action::commit_deleted Committing a deletion. $SVN::Wc::Notify::Action::commit_replaced Committing a replacement. $SVN::Wc::Notify::Action::commit_postfix_txdelta Transmitting post-fix text-delta data for a file. $SVN::Wc::Notify::Action::blame_revision Processed a single revision's blame. SVN::Wc::Notify::State $SVN::Wc::Notify::State::unknown Notifier doesn't know or isn't saying. $SVN::Wc::Notify::State::unchanged The state did not change. $SVN::Wc::Notify::State::missing The item wasn't present. $SVN::Wc::Notify::State::obstructed An unversioned item obstructed work. $SVN::Wc::Notify::State::changed Pristine state was modified. $SVN::Wc::Notify::State::merged Modified state had mods merged in. $SVN::Wc::Notify::State::conflicted Modified state got conflicting mods. SVN::Wc::Schedule $SVN::Wc::Schedule::normal Nothing special here. $SVN::Wc::Schedule::add Slated for addition. $SVN::Wc::Schedule::delete Slated for deletion. $SVN::Wc::Schedule::replace Slated for replacement (delete + add) SVN::Wc::Status $SVN::Wc::Status::none Does not exist. $SVN::Wc::Status::unversioned Is not a versioned node in this working copy. $SVN::Wc::Status::normal Exists, but uninteresting. $SVN::Wc::Status::added Is scheduled for addition. $SVN::Wc::Status::missing Under version control but missing. $SVN::Wc::Status::deleted Scheduled for deletion. $SVN::Wc::Status::replaced Was deleted and then re-added. $SVN::Wc::Status::modified Text or props have been modified. $SVN::Wc::Status::merged Local mods received repos mods. $SVN::Wc::Status::conflicted Local mods received conflicting mods. $SVN::Wc::Status::ignored A node marked as ignored. $SVN::Wc::Status::obstructed An unversioned resource is in the way of the versioned resource. $SVN::Wc::Status::external An unversioned path populated by an svn:externals property. $SVN::Wc::Status::incomplete A directory doesn't contain a complete entries list. perl v5.12.1 2007-11-05 native::Wc(3)
All times are GMT -4. The time now is 11:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy