Sponsored Content
Full Discussion: complex find command
Top Forums UNIX for Advanced & Expert Users complex find command Post 302364155 by noam128 on Thursday 22nd of October 2009 07:54:17 AM
Old 10-22-2009
Thank you for answering,
It is possible to use them together but when you use them together it is undefined who goes first. Sometimes first the type will be checked and then the exec activted and sometimes the other way around.

---------- Post updated at 06:53 AM ---------- Previous update was at 06:52 AM ----------

the solaris man page.
Solaris 5.10

---------- Post updated at 06:54 AM ---------- Previous update was at 06:53 AM ----------

Code:
Using -type is not sufficient to restrict the  type
     of  files on which the -exec command operates, because there
     is an inherent race condition between  the  type-check  per-
     formed by the find command and the time the executed command
     operates on the file argument.

---from the man page
 

10 More Discussions You Might Find Interesting

1. Answers to Frequently Asked Questions

advanced/complex uses of the find command

Perhaps the number one advanced find question is: How to stop find from descending into subdirectories? find command Performing a non-recursive find in Unix Use -prune with find command on AIX Searching for files over 30 days old in current directory disk space used for files with in a... (0 Replies)
Discussion started by: Perderabo
0 Replies

2. Shell Programming and Scripting

complex command substitution

hi, I have to execute this line below from within a shell script; simply backquoting it is not doing the trick; it is mangling up all the options; but when i type it out on a command line, it executes cleanly. Please help me in getting this right; $ vlc -I dummy --sout='#transcode{vcodec=mp4v,... (5 Replies)
Discussion started by: spopuri
5 Replies

3. Shell Programming and Scripting

complex grep command

hi all i have file call "list.log" which contains like this 00300 000024501043846 0 00300 000034531322871 0 00600 000000489100734 0 and so on .. the file goes like this:(example first row) from position 1-5 the lider number(300),position 7-21 id... (0 Replies)
Discussion started by: naamas03
0 Replies

4. Shell Programming and Scripting

Complex find grep or sed command

Haven't worked in bash for ages. did a good bit of shell scripting in regular sh, but have forgotten most of it. I have several thousand php files that now include the following line at the end of the file. There is no LF or CR/LF before it begins, it is just concatenated to the final line of... (3 Replies)
Discussion started by: sjburden
3 Replies

5. Shell Programming and Scripting

complex find in script

How to I put my find command string into a script. It is currently to long to be entered manually at command line. for FNAME in `find /unixsxxx/interface/x.x/xxxxxx -type f \( -name '*.KSH' -o -name '*.sh' -o -name '*.sql' -o -name '*.ksh' \) -exec grep -il xxx.xxx.xxx.xxx {} \;`; do C=`grep -c... (5 Replies)
Discussion started by: TimHortons
5 Replies

6. Shell Programming and Scripting

pls help! complex find and replace

help pls... i would like to change this CURVE2 565489 789458 1258649 random data here... CURVE2 565489 568795 6548921 random data here... CURVE2 565489 123598 6446259 random data here... CURVE2 565489 672956 2489657 into this CURVE2 565489 586423 1258649 random data here...... (2 Replies)
Discussion started by: lakanino
2 Replies

7. Shell Programming and Scripting

find command with complex logic

I'm looking to write a script that will do a find of directories and delete them if they are older than x days but keep the last x # of folders even if they are older than x days. The usage is for a deployment location, so we want to keep the location clean but retain maybe the last 2 builds that... (5 Replies)
Discussion started by: MaureenT
5 Replies

8. UNIX for Advanced & Expert Users

Help with complex find syntax

I need to modify the find command below to exclude the output of the directory /usr/UDPM/PerfMgmt/shmlck find / \( -fstype ctfs -o -fstype mntfs -o -fstype objfs -o -fstype proc -o ! local \) -prune -o -type f -perm -0002 -print 2>/dev/null I have tried many iterations and placement of... (2 Replies)
Discussion started by: interesting?
2 Replies

9. Shell Programming and Scripting

Complex find and replace only 1st instance string with dynamic combination

test.txt is the dynamic file but some of combination are fix like below are the lines ;wonder_off = ;wonder_off = disabled wonder_off = wonder_off = disabled the test.txt can content them in any order #cat test.xt ;wonder_off = ;wonder_off = disabled wonder_off = wonder_off =... (5 Replies)
Discussion started by: SilvesterJ
5 Replies

10. Shell Programming and Scripting

Complex grep command

Hallo Team, I need your help and its rather urgent. I have a file with thousands of lines. Here is a sample below: Sample1.txt BW235045560121114833444044@196.35.130.5 BW235106757121114-574455394@196.35.130.5 BW2349514941211141077771352@196.35.130.5... (5 Replies)
Discussion started by: kekanap
5 Replies
PATHCHK(1)						    BSD General Commands Manual 						PATHCHK(1)

NAME
pathchk -- check pathnames SYNOPSIS
pathchk [-p] pathname ... DESCRIPTION
The pathchk utility checks whether each of the specified pathname arguments is valid or portable. A diagnostic message is written for each argument that: o Is longer than PATH_MAX bytes. o Contains any component longer than NAME_MAX bytes. (The value of NAME_MAX depends on the underlying file system.) o Contains a directory component that is not searchable. It is not considered an error if a pathname argument contains a nonexistent component as long as a component by that name could be created. The options are as follows: -p Perform portability checks on the specified pathname arguments. Diagnostic messages will be written for each argument that: o Is longer than _POSIX_PATH_MAX (255) bytes. o Contains a component longer than _POSIX_NAME_MAX (14) bytes. o Contains any character not in the portable filename character set (that is, alphanumeric characters, '.', '-' and '_'). No com- ponent may start with the hyphen ('-') character. EXAMPLES
Check whether the names of files in the current directory are portable to other POSIX systems: find . -print | xargs pathchk -p DIAGNOSTICS
The pathchk utility exits 0 on success, and >0 if an error occurs. SEE ALSO
getconf(1), pathconf(2), stat(2) STANDARDS
The pathchk utility conforms to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
A pathchk utility appeared in FreeBSD 5.0. BSD
May 21, 2002 BSD
All times are GMT -4. The time now is 09:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy