Linux / UNIX Tech Support Forum
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........
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
hi,
Can u help me to implement find command of unix with -print, -exec, -name options using perl..... |
| 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; 22-08-2007 at 12:17 PM. |
![]() |
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 | 10-04-2008 02:22 AM |
| Linux Find Out RAM CAS Latency Command | andrei048 | Linux hardware | 1 | 04-01-2008 10:56 AM |
| Use memory command to find details under Fedora Linux | chiku | Getting started tutorials | 0 | 29-04-2007 08:35 PM |
| Find out information about my file - explaining ls command | sweta | Getting started tutorials | 1 | 11-01-2007 04:21 PM |
| how to find perl version | All about FreeBSD/OpenBSD/NetBSD | 1 | 28-01-2006 05:20 PM | |