Linux find command seems to not transmit all the result to the '-exec command'
Hello.
From a script, a command for a test is use :
Tha command return the following in the console screen :
Within that script the function 'COPY_CHERCHE ' is define as this :
Now we change the test command with the real command :
As tou can see, 4 parameters are sent to the function :
Parameter 1 : the file found by the find command --> "{}"
Parameter 2 : a folder name where to copy the founded file
parameter 3 : the character '¤' which is just flag
parameter 4 : a file where to log operations
My problem is that only one file is taken into account : ''/home/user_install/.inputrc"
The default between two conditional arguments like -type f or -name xyz is AND.
You can explicitely write -type f -a -name xyz.
The AND makes it necessary to evaluate the second condition if the first condition evaluated TRUE.
The AND has precedence over the -o OR.
If you want to evaluate an OR before an AND you need to work with parenthesis (that must be quoted to escape their special meaning in the shell).
This User Gave Thanks to MadeInGermany For This Post:
Hi all,
I am trying to find files newer than a given file and them mv them to a new location.
So I far I have:
find . ! -newer <file_name> -exec ls -l {} \;
and
find . ! -newer <file_name> -exec mv /TEMP_LOCATION {} \;
find is not liking this.
Anyone know how to modify the last... (2 Replies)
Hi,
I have two scripts that remove files. One works fine and is coded
find -name "syst*" -mtime +1 -exec rm {} \;
The other is almost the same - only thing missing is the '\'. On that script though I keep getting:
rm syst1202.file ?
etc
Does the \ make that difference or is it a... (3 Replies)
Hi all,
Please could someone help with the following command requirement.
I basically need to find files NEWER than a given file and order the result on time.
My attempt so far is as follows:
find . -newer <file_name> -exec ls -lrt {} ;\
But I dont seem to get the right result... (12 Replies)
Hi,
I want to write the shell script to change multple file name (the file name is get from DB)
e.g. cp db1.txt file1_new.txt
cp db2.txt file2_new.txt
cp db3.txt file3_new.txt
I have write the script like this:
VAR=`sqlplus -s $LOGON @<<ENDOFTEXT
set termout off
... (0 Replies)
Hi People,
I have a directory full of compressed files (.Z extention)
In many of these files there is a string pattern (3800078163033)
I want to find all file names which contain this string in their text.
Regards,
Abhishek (2 Replies)
Hi There,
I have a script which finds for log files and removes them if the file has changed in the last day.
The script runs fine without errors. The log file is still there. So, I decided to print the find command and run the command outside the script. Getting "Incomplete statement"
Can you... (6 Replies)
Hi,
I'm using the following command to get a list of files on the system.
find /releases -type f -exec ls -l > /home/sebarry/list.txt '{}' \;
however, its searching a directory I don't want it to search so I know I have to use prune but I don't seem to be able to get prune and exec to work... (2 Replies)
Hi,
I'm using the following command to get a list of files on the system.
find /releases -type f -exec ls -l > /home/sebarry/list.txt '{}' \;
however, its searching a directory I don't want it to search so I know I have to use prune but I don't seem to be able to get prune and exec to work... (1 Reply)
Hi All,
i am writing a shell script in korn shell
which deletes all the files in a directory
once in every 10DAYS.
the directory has different format files.
the script has something like this;
cd /home/data/pavi
echo "Please Enter the Number of Days to search for"
read DAYS... (2 Replies)