What's wrong with this command line pls?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting What's wrong with this command line pls?
# 1  
Old 07-06-2010
What's wrong with this command line pls?

I executed the following command and got Arg List too long.

Code:
find /dir1/dir2/LOG_* -prune -type f -mtime +3 -exec echo {} \;

What's that about?
# 2  
Old 07-06-2010
The "/dir1/dir2/LOG_*" part gets evaluated by the shell, which substitutes every entry in dir2 that matches LOG_* for the complete path. If that's more files/directories than the OS can handle, it will fault.

Better rewrite it as
Code:
find /dir1/dir2/ -name 'LOG_*' -prune -type f -mtime +3 -exec echo {} \;

Note that the position of -prune is important!
# 3  
Old 07-06-2010
Ahhhhh ... sweet!.

Thanks dude.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

what's wrong with my awk line?

] && { echo "The free mem need to be more than 2G" } (3 Replies)
Discussion started by: yanglei_fage
3 Replies

2. Shell Programming and Scripting

Need Help with greping two line from a file Pls help ASAP

Hi all - I''m in a little bit of jam - If you can please help I have a file that has the following content ( please see below) I need to read the file and then get this result in this format ------------- To put out in this format name: sophis Total: 22328 name: tca ... (2 Replies)
Discussion started by: mnassiri
2 Replies

3. Shell Programming and Scripting

line separate (pls)

Hello everybody I made code to move some files to another place for example(I moved MM file TO BIN folder ) and the MM path I put it in different file e.g(0:HOME/unixstuff/MM) so my question is who I can separate the path line and use the number 0: and MM as parameter because if I want to... (2 Replies)
Discussion started by: falm
2 Replies

4. Shell Programming and Scripting

what is wrong with this expr line

It keeps giving me expr syntax error. expr "${etherline }" : ’.*no match found’ 2>&1 >/dev/null Thanks in advance. (1 Reply)
Discussion started by: shadow_boi
1 Replies

5. Shell Programming and Scripting

whats wrong in this pls help how to take $i value ?

for i in `cat rgu` do echo $i sed -e '/LABEL=$i/,/fi/d' g_scripts > g_scripts2 cat g_scripts2 > g_scripts done (3 Replies)
Discussion started by: santosh1234
3 Replies

6. Shell Programming and Scripting

How to get it in single line. pls help

Hi, when i am executing this script, i am getting the values of TID and Intime in different lines. How can i print both output values in a single line. please advise _____________________________ #!/bin/ksh export Path="/abc/def/ghi"; Home="/abc/jkl/prt"; cd $Path cat $Home | while read... (3 Replies)
Discussion started by: Prat007
3 Replies

7. Shell Programming and Scripting

what is wrong with this line?

system ("$ssh '$perf_stats' < temp_pipe 2>&1 &"); I need to start and interact with my executable defined by perf_stats on a remote machine but not change my command line to that of the remote machine. temp_pipe is a node created by mknod -f temp_pipe (6 Replies)
Discussion started by: looza
6 Replies

8. Shell Programming and Scripting

check position of end of line(URGENT PLS)

I Have to check in a file that all the lines are ending at same posiotin. Ex : line 1 is ending at position 88 line 2 should at same position i.e 88 Thanks in advance (6 Replies)
Discussion started by: evvander
6 Replies

9. UNIX for Dummies Questions & Answers

0403-057 Syntax error at line 70. pls help

Hi All, I got a script from one of the unix forums for reporting on filesystem usage and wanted to use it but it keeps giving me the following error. 0403-057 Syntax error at line 70 The script is shown below. Pls help as I am new to UNIX. # set -x # D I S K S P A C E . S H # #... (2 Replies)
Discussion started by: OMONI
2 Replies

10. UNIX for Dummies Questions & Answers

One line of cron is not working - PLS Help

Hi all, I have spent 2 hours going through the forum and have not found an answer to my question, I hope someone can help. I have cron setup to run two commands, one at 1am and one at 3 am, the one at 1 am works but not the one at 3 am. The time is set as: 0 1 * * * /path/to/file 0 3 * * *... (3 Replies)
Discussion started by: burnie
3 Replies
Login or Register to Ask a Question