Putting the too many arguments into find hasn't stopped them from being too many arguments. You need to not give them too many arguments.
Let find handle the pattern matching. That way, you only give it one argument.
You can give find more than one folder, too, and handle it all at once.
-name can match files like you were doing inside the shell, without having to match inside the shell, avoiding the 'too many arguments' problem. Putting it in single quotes prevents the shell from trying to expand it too soon.
Using '+' instead of ';' will cause it to put as many files as it can into each rm call instead of running rm 10,000 individual times for 10,000 individual files, which will make it more efficient.
Remove the echo once you've tested and are sure it does what you want.
These 2 Users Gave Thanks to Corona688 For This Post:
I've made an awk command that works successfully.
However I'd like to add one character to it.
For example instead of /what_i_have_now/
I'd like to change just ONE field to the opposite with an exclamation point.
Like this: ! /what_i_have_now/
My question, where am I supposed to place... (1 Reply)
I wish to seach a Dir for a specific file, once the file is found i will perform additional logic. If the file is not found within two hours, i would like to exit.
Logically, I'm looking for the best way to approach this
Thanks for any assistance in advance.
Note: I'm using a C shell and... (2 Replies)
Hello All,
I looking for a way to verify the correction of shell script syntax.
Is there any switch like -c in perl which do this in shell ?
Thank You. (1 Reply)
Hi,
I am a unix newbie. I need to write a script to check wheteher another script is still running. If it is, then sleep for 30m and then check again if the script is running. If the script has stopped running then, I need to come out of the loop.
I am using RHEL 5.2 (2 Replies)
hello everyone
i am beginner on shell scripting .and i am working on my project work on ad hoc network
i wrote a batch (.sh) to do a looping and execute a tcl script i wrote before in each iteration ..but i got this problem "
syntax error near unexpected token `('... (1 Reply)
Hello i have question that i want check syntax from my script shell with sh -n filename
but it's not show something even i have wrong syntax in my file. why can this happened or any other way to check it?
i use on header of file :
#!/bin/sh
thx before :) (7 Replies)