Sponsored Content
Top Forums UNIX for Dummies Questions & Answers I want alternative of -maxdepth 1 for all Linux,Solaris and AIX Post 302744975 by laxmikant.hcl on Sunday 16th of December 2012 05:38:33 AM
Old 12-16-2012
I want alternative of -maxdepth 1 for all Linux,Solaris and AIX

Code:
find /full/path/dir \( ! -name dir -o -type f \) -prune -type f

on AIX it worked perfect :

Code:
sdp1:/var/tmp/test# find /var/tmp/test/ \( ! -name test -o -type f \) -prune \
  -name "*properties" -type f -exec ls -l {} \; -exec cksum {} \;

-rw-------    1 root     system           19 Dec 12 02:03 /var/tmp/test/1.properties
3921676744 19 /var/tmp/test/1.properties
-rw-------    1 root     system           22 Dec 12 02:04 /var/tmp/test/2.properties
2544875996 22 /var/tmp/test/2.properties


but on LINUX it does not
Code:
[root@omu-au213 /var/tmp/test]# find /var/tmp/test/ \( ! -name test -o -type f \) -prune \
  -name "*properties" -type f -exec ls -l {} \; -exec cksum {} \;
[root@omu-au213 /var/tmp/test]#


it asks to use -wholename option but that does not work on AIX !!



i tried
Code:
cd /var/tmp/test/ && find . \(  -name . -o -prune \) -name "*properties" -type f \
  -exec ls -l {} \; -exec cksum {} \;

it works on all but it does not gives fuul qualified path name (/var/tmp/test/2.properties) of a file see below :

Code:
 -rw-------    1 root     system           19 Dec 12 02:03 ./1.properties
3921676744 19 ./1.properties
-rw-------    1 root     system           22 Dec 12 02:04 ./2.properties
2544875996 22 ./2.properties



i want a generic alternative of -maxdepth 1 for all linux,solaris and AIX. please help!!

Last edited by Scott; 12-16-2012 at 06:56 AM.. Reason: Please use code tags; Added \ line breaks to make code more readable
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Major differences between AIX, Solaris, HP-UX, Linux

Hi All, I want to know the OS level differences between AIX, Solaris, HP-UX, Linux Apart from the vendor, H/w and command differences, any other significant points. regards, guru Charan (9 Replies)
Discussion started by: gurukottur
9 Replies

2. AIX

AIX on an alternative system

My greeting to all the readers I have an AIX 5.3 version. I want to study this operation system. Unfortunately I don't have an IBM p Series system. Is there a way to install AIX on vmware or something similar? May be I have an old IBM Netfinity Server, will AIX run on this system? Thanks for... (5 Replies)
Discussion started by: analyzer
5 Replies

3. UNIX for Dummies Questions & Answers

Solaris find without maxdepth

Hi, I am using Solaris 5.8 I searched online, the find command has an option called maxdepth which can be used to limit the number of directories find will look into. find . -maxdepth 2 -type f When I run the above command in solaris, I get an error find: bad option -maxdepth find:... (2 Replies)
Discussion started by: Leion
2 Replies

4. AIX

maxdepth in avaible for AIX?

Hi, I'm trying to do a search in a directory on AIX and I was wondering if there's an equivelant option to the -maxdepth option to tell how far down to search. I ran this but I just want to make sure it's actually searching everything: find ./* -type f -name "090817*" -exec ls -l {} \; (1 Reply)
Discussion started by: bbbngowc
1 Replies

5. Solaris

Patch management (Solaris, AIX , Linux )

Hi Guys, I am doing L1 Level support for Solaris Platform. Eg. User Management, File system , Print management and Job monitoring. I recently completer my IBM Aix 7 Administration certification. Issue is that my manager is asking me do full time unix / linux patch management work for new... (5 Replies)
Discussion started by: Nats
5 Replies

6. Shell Programming and Scripting

Maxdepth command not working in AIX.Need alternative solution for this command

Hi All, I am trying to select 30 days older files under current directory ,but not from subdirectory using below command. find <Dir> -type f -mtime + 30 This command selecting all the files from current directory and also from sub directory . I read some documention through internet ,... (1 Reply)
Discussion started by: kommineni
1 Replies
Apache2::Build(3pm)					User Contributed Perl Documentation				       Apache2::Build(3pm)

NAME
Apache2::Build - Methods for locating and parsing bits of Apache source code SYNOPSIS
use Apache2::Build (); my $build = Apache2::Build->new; # rebuild mod_perl with build opts from the previous build % cd modperl-2.0 % perl -MApache2::Build -e rebuild DESCRIPTION
This module provides methods for locating and parsing bits of Apache source code. Since mod_perl remembers what build options were used to build it, you can use this knowledge to rebuild it using the same options. Simply chdir to the mod_perl source directory and run: % cd modperl-2.0 % perl -MApache2::Build -e rebuild If you want to rebuild not yet installed, but already built mod_perl, run from its root directory: % perl -Ilib -MApache2::Build -e rebuild METHODS
new Create an object blessed into the Apache2::Build class. my $build = Apache2::Build->new; dir Top level directory where source files are located. my $dir = $build->dir; -d $dir or die "can't stat $dir $! "; find Searches for apache source directories, return a list of those found. Example: for my $dir ($build->find) { my $yn = prompt "Configure with $dir ?", "y"; ... } inc Print include paths for MakeMaker's INC argument to "WriteMakefile". Example: use ExtUtils::MakeMaker; use Apache2::Build (); WriteMakefile( 'NAME' => 'Apache2::Module', 'VERSION' => '0.01', 'INC' => Apache2::Build->new->inc, ); module_magic_number Return the MODULE_MAGIC_NUMBER defined in the apache source. Example: my $mmn = $build->module_magic_number; httpd_version Return the server version. Example: my $v = $build->httpd_version; otherldflags Return other ld flags for MakeMaker's dynamic_lib argument to "WriteMakefile". This might be needed on systems like AIX that need special flags to the linker to be able to reference mod_perl or httpd symbols. Example: use ExtUtils::MakeMaker; use Apache2::Build (); WriteMakefile( 'NAME' => 'Apache2::Module', 'VERSION' => '0.01', 'INC' => Apache2::Build->new->inc, 'dynamic_lib' => { 'OTHERLDFLAGS' => Apache2::Build->new->otherldflags, }, ); AUTHOR
Doug MacEachern perl v5.14.2 2013-03-12 Apache2::Build(3pm)
All times are GMT -4. The time now is 06:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy