No luck.....the prune up front stops all files from being listed.
I think I have to do this in multiple steps, find the files, awk the output to remove directories, and then pipe the results to a rm command.
Not sure if that can be done, buy will try...
Stirke two....-level is not supported...
I'm a bit closer with.... find . -type f -name "*.20*" -mtime +10 -o -type d -name archive -prune -exec rm {} \;
it bypasses the files in the sub dir archive(GOOD), but does list archive dir, and tries to delete entire dir(BAD).
I am trying to search for all files with "*20*" in the file name, but this command keep searching subdirectories.
I need to search only at the current level.
find . -name "*.20*" -mtime +10;
I have tried -prune, -depth, but still no luck.
Any thoughts?
I tried that but get:
tar -cvf configtool.tar configtool
tar: configtool.tar: A file or directory in the path name does not exist.
Do I need to specify that its a directory?
Getting the following message on this:
drwxr-xr-x 2 xxxxxxx xxxxxxxx 256 Oct 17 16:01 configtool
tar -cvzf configtool.tar configtool
tar: Not a recognized flag: z
Usage: tar -{c|r|t|u|x} [-BdFhilmopsvw]
[-Number] [-fFile]
[-bBlocks] [-S [Feet] [Feet @Density]...
Need to create db2 where clause to het current day - 30 days, in the format of 2006051800 to compare against datetime field. 00 can be appended, I hope.
Thanks in advance.
I have two options. Get unix current date -30 days, and feed that into a db2 where clause, or have the db2 where clause itself get current daye - 30 days, in the format of char 2006051800. 00 can be appended, I hope.
Thanks in advance.
Thanks for the great method to break down the file.
I still need to be able to search for a string though. I need to find the string of job "ABC Started" somewhere on the line, then capture the date and time, then search for another string on another row of the file, and search for "ABC...
I have log file that contains job names with start and end times. I have to search through the log to find "jobname started" and hold it, then search again for "jobname ended", and then report the jobname, start time, end time, elapsed time.
I have 12 jobs to search for and report on, so that...
Great...I have the format, but should it be wrapped inside an if statement? I actually have to strings to look for and by pass...
substr($0,1,42)=="0000671960595 19012" {next}
substr($0,1,36)=="99994661 " {next}
Should they go before the...
I currently use the below script to modify a file, but I have to find a string starting in postion 37, like "19012", and delete that row, and continue with the rest of the script.
How do I NOT print that row out?
1==NR { print; next }
NR>2 { print fix(line) }
{line = $0}
END { print line }...
I have installed embaraderos rapid sql software, but I do not have an odbc driver for db2. Any suggestions on where to find one? If I do a search, I get all sorts of hits, but I just want the one driver, not a suite of drivers. Also, are there any free ones out there?
Great stuff so far, but using vlads code, the last row is getting updated with the 3. It's not recognizing the last row code. Also the output is displayed to the screen, but the file is not getting updated.
Thanks again for your help...
Thanks Vlad...
I guess I'm having a brain freeze. I created the bosox.awk file, and tried to run the script. I'm getting a cannot find or open file -f. Here is the line i'm trying to run.
nawk -v pos=10 -v last=`wc -l < bosox.txt` -f bosox.awk bosox.txt
I used chmod to grant x for...
Oh yea...The column I really need to replace is in column 307. I used column 10 just as an example. That may have an impact on the answer, incase you were thinking of using "." as a wild card.
Hi,
I have a batch file with a header and trailer record, with dataline records in the middle. I need to replace only the rows with a space in column 10 with the number 3, and not alter other rows, or the header and trailer.
99999123 ACCOUNT DATA Header
123456789012345678901234567890...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.