Sponsored Content
Homework and Emergencies Homework & Coursework Questions Check whether a Directory is empty or not Post 302649725 by upvan111 on Friday 1st of June 2012 03:25:21 AM
Old 06-01-2012
Check whether a Directory is empty or not

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:
1.pls tell me the command for checking whether a given directory is empty or not .
2. can i check what is the last copied item in a directory .
and i yes , i want to move that last copied item in another directory .

pls help me with shell code for these two tasks

thanks


2. Relevant commands, code, scripts, algorithms:

ls -l displays it on terminal

3. The attempts at a solution (include all code and scripts):

ls - l does it , but i dont know how to use it for getting last entry


4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):


its a part of research on analysing executables.
professor M.S. gaur
MNIT jaipur
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check for empty string

Hello All, I have written shell script whcih at the max 3 parameters. When only one commandline argument and other two command line arguments are passed as empty string like eg : archive ' ' ' ' Then i need to check whether the commandline... (12 Replies)
Discussion started by: rahman_riyaz
12 Replies

2. UNIX for Dummies Questions & Answers

How to check if a file is empty?

Hi Masters..... I have problem !!! I need to check number of records in a file and if it is zero or file is empty i need to do some task. if ; then echo "File s empty" else echo "Not empty" fi so how to check this condition. I used wc -l < filename.txt => 1 for zero records same result... (1 Reply)
Discussion started by: shreekrishnagd
1 Replies

3. Shell Programming and Scripting

check if file is empty

How do I check if a file is empty in a sh script I want to test in my shell script if the output file is empty and if it is do one thing and if it isnt empty do another? any ideas? (8 Replies)
Discussion started by: stolz
8 Replies

4. Shell Programming and Scripting

check whether the directory is empty or not

I have the list of users in user.log, under each user folder there is sub1 folder is there. i want to check whether sub1 is empty or not, if it is empty i have to skip that user user folder and iterate next user folders. i have the sample code,its not giving not proper results. while read line... (8 Replies)
Discussion started by: KiranKumarKarre
8 Replies

5. Shell Programming and Scripting

check empty directory !!!

I need to check if a directory is empty using an if condition in the pseudocode below if ; then else although i looked at a few forums on this topic, I left feeling a little unclear and i could not use the command successfully what can i substitute in the if conditon above,... (2 Replies)
Discussion started by: allah_waris45
2 Replies

6. Shell Programming and Scripting

Empty Directory Check

Hi All, I have a requirement to check all the files in a directory and mail non empty files Files are in csv format , i need to skip header while checking pls help Thanks (12 Replies)
Discussion started by: gwrm
12 Replies

7. Shell Programming and Scripting

Check whether a Directory is empty or not

1.pls tell me the command for checking whether a given directory is empty or not . 2. can i check what is the last copied item in a directory . and i yes , i want to move that last copied item in another directory . pls help me with shell code for these two tasks thanks (1 Reply)
Discussion started by: upvan111
1 Replies

8. Shell Programming and Scripting

Empty file check

Hi gurus , I have two files and i want to perform different action based on the condition if both or either is empty If then Do something elif then do something elif then do something else do something fi I have tried the below bt its not... (4 Replies)
Discussion started by: r_t_1601
4 Replies

9. Shell Programming and Scripting

Cant check empty string

Hello So i have that script collection, in which i have a single script to create a configuration file. In there, i have multiple occourences of something like this: prj_title=$(tui-read "What is the TITLE? ($prj_name):") ] && prj_title="${prj_name/_/ }" They all work as expected, if... (5 Replies)
Discussion started by: sea
5 Replies

10. Shell Programming and Scripting

How can I check, if on remote server directory is empty or have files?

I have a script, which is supposed to run 1 day of the month, connect to remote server certain directory, find files, tar the, and copy find . -ctime -1 | tar -cvf transfer_dmz_start_monthly.tar *${Today}*.*; if then echo "Cannot create a tar file, the terminated... (2 Replies)
Discussion started by: digioleg54
2 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.10.0 2007-11-05 native::Wc(3)
All times are GMT -4. The time now is 02:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy