This is a discussion on Implementation of find command in Perl within the Shell scripting forums, part of the Development/Scripting category; hi, Can u help me to implement find command of unix with -print, -exec, -name options using perl........
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
| Sponsored Links | ||
|
|
|
|||
|
I'm not sure I understand what you are trying to do ..... if you want to execute a shell command using perl .. AFAIK, you can use the following formula :
system("COMMAND"); for example : Code:
system("find /home -type d -iname "nixcraft" -print -exec ls {} \;");
|
|
||||
|
Go for the File::Find perl module. It include Find() function that mimics the UNIX/Linux find command and will traverse a file tree. Here's the API for the method:
Code:
Find(\&yoursubroutine, "/tmp", "/usr",..); More examples @ http://www.unix.org.ua/orelly/perl/sysadmin/ch02_04.htm A.L.E.X, system() is fine but file::find is way to go.. PS: always use The CPAN Search Site - search.cpan.org to get all info about perl stuff Last edited by monk; 08-22-2007 at 01:17 PM.. |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| unix find out ram usage command | charvi | Solaris/OpenSolaris | 4 | 04-10-2008 03:22 AM |
| Linux Find Out RAM CAS Latency Command | andrei048 | Linux hardware | 1 | 01-04-2008 11:56 AM |
| Use memory command to find details under Fedora Linux | chiku | Getting started tutorials | 0 | 04-29-2007 09:35 PM |
| Find out information about my file - explaining ls command | sweta | Getting started tutorials | 1 | 01-11-2007 05:21 PM |
| how to find perl version | All about FreeBSD/OpenBSD/NetBSD | 1 | 01-28-2006 06:20 PM | |