nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

perl script to find the owners different than root in a directory

This is a discussion on perl script to find the owners different than root in a directory within the Shell scripting forums, part of the Development/Scripting category; Hi all, i am new to perl and i want to make this work in perl.. please help is it ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 15-06-2009, 02:10 PM
Junior Member
User
 
Join Date: Jun 2009
OS: Debian
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
saapa is on a distinguished road
Default perl script to find the owners different than root in a directory

Hi all,
i am new to perl and i want to make this work
in perl.. please help

is it possible to save the output of a unix command executed in perl to be saved in hash variable..

like i have the command

`find $mypath ! -user mainuser -printf \"\%u \%h\\n\"`;

this will print all the users other than mainuser with their paths.

example this is the output:
john /johnsaddress/
john /johnspincode/
john /johnscity/
james /jamesaddress/
james /jamespincode/


i want to parse the file (1st column) and save
the strings only once along with their whole
data.
like above the result should be john and james
stored in some variable and their
corresponding data also stored.

so is possible to capture directly the result into a hash(hash of arrays) which stores the key as username and all the paths of a particular user as values.

thanks for ur help and suggestions in advance
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Find Unix Linux File / Directory by date And Then Copy / Move File asim.mcp CentOS / RHEL / Fedora 1 10-08-2008 03:30 AM
Change root password using perl script? Raj1 Solaris/OpenSolaris 8 13-06-2008 11:01 PM
Implementation of find command in Perl Bhushan Shell scripting 2 22-08-2007 12:15 PM
How to Prevent Uploading Perl Scripts in /tmp Directory bipinkdas Web servers 1 25-06-2007 08:57 PM
how to find perl version All about FreeBSD/OpenBSD/NetBSD 1 28-01-2006 05:20 PM


All times are GMT +5.5. The time now is 08:33 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38