I'm trying to find files that are greater then 30 days old, zip them and move to a different directory. I'm encountering an issue passing a variable (FilesToFind) to name within the find command. Here's the code I'm running:
If there's only 1 file retrieved on the find, the code works. If there's more then one file, I get the following error message:
find: missing conjunction
If I hard code "*.dat" in the find statement, then it works correctly for multiple files, as so:
So theoretically it seems like I should be able to pass "*.dat" to FilesToFind and it would work. So I've also tried the following, that don't give an error message, but also don't work. No files are retrieved:
I've done a search through the forum, but can't find anything that covers this. I need to be able to use a variable for name vs hard coding it to "*.dat". This is a simplistic version of the code and that value is actually going to be variable. Any suggestions on what I'm doing wrong?
Hi
I have a JAVA based application in development and production environment. These two environments are exactly identical in terms of OS, hardware and application components.
Initially the OS was Solaris 5.6 and the application was working fine in both environments. But later when the OS... (12 Replies)
Hi Guys,
I have a file called error.logs. am just trying to display the content in the file which was modified last 1 day. I tried below command but it doesnt give the proper output.
find /u/text/vinoth/bin "error.logs" -mtime -1 -exec cat {} \; >> mail.txt
Any help is much... (21 Replies)
Guys,
Here is my requirement..
Sample.cfg
file="*log.gz *txt.gz"
sample.sh
#!/bin/sh
. $HOME/Sample.cfg
find . -name "$file" -mtime +20 -exec ls -la {} \;
Its not finding the given *log.gz and txt.gz files.
Could anyone please help me? (8 Replies)
Hello Everyone,
I have a csv file with text qualifier as "" and data similar to below:
"1","abc","address1","US"
"2","def","address1 "characters in double-quote" address2","IND"
"3","ghi","address1","UK"
In above example, for record 2, we have an issue as in column3 contains double... (2 Replies)
Hi All,
I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command.
The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Hi All,
I am trying to use a variable within the sed command but I am not able to get the output.
When I am using the following command (without variable) its working fine:
sed -n '/2011\/12\/10 18:11:11./,$p' < Log.txt > Delta_Log.txt
But when I am putting the value 2011\/12\/10... (4 Replies)
can someone please explain to me what i'm doing wrong with this code:
WELT=$(awk '(($1 ~ "^${caag}$") || ($2 ~ "^${caag}$"))' /tmp/Compare.TEXT)
when run from the command line, it works. but it seems to be having a problem doing the comparison when variables are involved.
i tested from... (1 Reply)
Hi,
I am not root user. I am trying to find the file which has contains pattern "fvsfile" in root directory.
If i run the find cmd then i got permission denied and all the files are listed include pattern files. i cant get file name yet
find . print | xargs grep -i "fvsfile"
I want... (2 Replies)
I am currently using below command to get the 1st three characters of a file(PDM). Issue is, when i use find command in root dir, it finds all the files in sub dir also.
How to limit the find command search to a given path only(ie: say only find file in apps/cmplus/datamigration/data path... (3 Replies)
The client's app gets a 'suspend error' which they say is due to a null pointer exception. Application people say nothing's wrong with the app. Network people say the network's fine. I'm supposed to see what's wrong with the system to be causing this error. I checked the NIC card settings, which... (1 Reply)