12-30-2008
Hard to do it better.
I think that you found a good solution to your problem. But there is a small bug: ls must be called wirth -A option.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi guys,
I've been trying to get this part of my script to work for ages and now it's getting me annoyed!! So i thought a fresh group of eyes could see where i'm going wrong!
The idea is getting a directory and all its files moved to a temp folder, but similar to the rm -ir command where it... (0 Replies)
Discussion started by: olimiles
0 Replies
2. Shell Programming and Scripting
Hi all,
Can you tell me how to empty all files in a directory with a "find" command?
It does not seem to work the way I try it:
# ls -l *.dat
-rw-r--r-- 1 root root 7 Jul 20 20:51 la2.dat
-rw-r--r-- 1 root root 4 Jul 20 20:51 la.dat
# find... (9 Replies)
Discussion started by: majormark
9 Replies
3. Shell Programming and Scripting
Hi,
I need to delete an empty directory in a temp directory except "dir5" (keep everything that is not empty).
Plese advise.
Here is an example of my directory.
/dir/temp/
dir1 - delete if this is empty
dir2 - delete if this is empty
dir3 - delete if this is empty
dir4 - delete if this... (7 Replies)
Discussion started by: sirrtuan
7 Replies
4. Shell Programming and Scripting
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
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
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. SCO
I know someone will probably laugh at this question, I probably knew the answer many years ago when I was doing this full time but here goes.....
I have a directory that has many files and sub-directories in it, RMDIR will not delete a directory that is not empty so what is the command to... (1 Reply)
Discussion started by: moondogi
1 Replies
8. Shell Programming and Scripting
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
9. Homework & Coursework Questions
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... (1 Reply)
Discussion started by: upvan111
1 Replies
10. Programming
Hi Guys,
i'm writing a perl script which whenever runs, should empty 3 pre-decided directories as first step and then the script has the logic to parse some other directories and copy the files inside those directories into these 3 directories. I've the logic already developed, just need to... (2 Replies)
Discussion started by: jhamaks
2 Replies
LEARN ABOUT MOJAVE
cpanplus::hacking
CPANPLUS::Hacking(3pm) Perl Programmers Reference Guide CPANPLUS::Hacking(3pm)
NAME
CPANPLUS::Hacking - developing CPANPLUS
DESCRIPTION
This document attempts to describe how to develop with the CPANPLUS environment most easily, how certain things work and why.
This is basically a quick-start guide to people who want to add features or patches to CPANPLUS.
OBTAINING CPANPLUS
Checkout CPANPLUS from its GIT repository at <https://github.com/jib/cpanplus-devel> .
INSTALLING CPANPLUS
CPANPLUS follows the standard perl module installation process:
perl Makefile.PL
make
make test
make install
CONFIGURING CPANPLUS
When running "perl Makefile.PL" you will be prompted to configure. If you have already done so, and merely wish to update the "Makefile",
simply run:
perl Makefile.PL JFDI=1
This will keep your configuration intact. Note however, if there are changes to the default configuration file "Config.pm-orig", you should
either delete your current config file and reconfigure, or patch your config file from the new entries in "Config.pm-orig".
RUNNING CPANPLUS FROM DEVELOPMENT ENVIRONMENT
If you'd rather not install the development version to your "site_perl" directory, that's no problem. You can set your "PERL5LIB"
environment variable to CPANPLUS' "lib" directory, and you can run it from there.
RUNNING CPANPLUS TESTS
Tests are what tells us if CPANPLUS is working. If a test is not working, try to run it explicitly like this:
perl -I/path/to/cpanplus/lib t/XX_name_of_test.t 1
The extra '1' makes sure that all the messages and errors (they might be errors we're testing for!) are being printed rather than kept
quiet. This is a great way to find out the context of any failures that may occur.
If you believe this test failure proves a bug in CPANPLUS, the long output of the test file is something we'd like to see alongside your
bug report.
FINDING BUGS
Sometimes you might find bugs in CPANPLUS' behaviour. If you encounter these in a development snapshot, we'd appreciate a complete patch
(as described below in the "SENDING PATCHES" section.
If it's way over your head, then of course reporting the bug is always better than not reporting it at all. Before you do so though, make
sure you have the latest development snapshot, and the bug still persists there. If so, report the bug to this address:
bug-cpanplus@rt.cpan.org
A good "patch" would have the following characteristics:
Problem description
Describe clearly what the bug is you found, and what it should have done instead.
Program demonstrating the bug
Show us how to reproduce the bug, in a simple of a program as possible
[OPTIONAL] A patch to the test suite to test for the bug
Amend our test suite by making sure this bug will be found in this, and future versions of CPANPLUS (see "SUPPLYING PATCHES")
[OPTIONAL] A patch to the code + tests + documentation
Fix the bug, update the docs & tests. That way your bug will be gone forever :)
SUPPLYING PATCHES
Patches are a good thing, and they are welcome. Especially if they fix bugs you've found along the way, or that others have reported.
We prefer patches in the following format:
o In "diff -u" or "diff -c" format
o From the root of the snapshot
o Including patches for code + tests + docs
o Sent per mail to bug-cpanplus@rt.cpan.org
o With subject containing "[PATCH]" + description of the patch
You will always be informed if a patch is applied or rejected, and in case of rejection why that is (perhaps you can tweak the patch to
have it accepted after all).
perl v5.18.2 2014-01-06 CPANPLUS::Hacking(3pm)