Search Results

Search: Posts Made By: prismtx
3,667
Posted By prismtx
That's working perfectly. This will get me going...
That's working perfectly. This will get me going so I can finish the script! Thanks for the help. :b:
1,837
Posted By prismtx
I don't know where you are physically, but here...
I don't know where you are physically, but here in most of the US, we switched to daylight savings time yesterday morning and moved the clocks ahead an hour. If you were running on a server here, it...
3,667
Posted By prismtx
I am running on a linux box and this worked for...
I am running on a linux box and this worked for the given example, however I need to change the value only if it is 2 lines after the value "COD" or "FAL". This is changing it even if the first...
3,667
Posted By prismtx
I tried your code, but it was processing one...
I tried your code, but it was processing one character at a time, so I tried to set the field sep to a new line FS="\n" and was able to get a line at a time, but it is not keeping the lines and it...
3,667
Posted By prismtx
Double search and replace?
I need to search for a line containing only 'XYY' or '//'. Then if the next line is either 'COD' or 'FAL' I need to replace positions 3-5 of the line 2 lines after that depending on its value.
So my...
1,967
Posted By prismtx
Do they allow you to have 2 chron jobs? You...
Do they allow you to have 2 chron jobs? You could run the same process twice or make a copy with a new name and run one at 0, 20, 40 minutes ant the other at 10, 30, 50 minutes.
5,682
Posted By prismtx
Thanks
Thanks Padow, that worked great.

abc=`find /export/home/MYACCT/ -type f -name \ar5.log ! -newer /WORKDIR/REF`

if [ -z "$abc" ]; then
count=${count}+1
sleep 3600
else
...
5,682
Posted By prismtx
Execute multiple commands in a find
I am checking that a file is older than a reference file that I build with a touch command before processing it. If it is not old enough, I want to sleep for an hour and check again.

My problem is...
6,781
Posted By prismtx
If extract.txt is your flat file, this will add...
If extract.txt is your flat file, this will add line 1001 to the end with a count of 1000.
trailer=`wc -l < extract.txt`
echo "$trailer" >> extract.txt
5,842
Posted By prismtx
I have done it by having a shell script execute a...
I have done it by having a shell script execute a sql file like this:

Shell script:
SQL1='select count(*) as City_Count from cities;'
SQL2='select count(*) as State_Count from states;'
sqlplus...
30,440
Posted By prismtx
That code is the same that I use to add headers...
That code is the same that I use to add headers and trailers. Verify that you have the input file defined correctly. Echo the file name or do an ls on it. It sounds like it may not be interpreting...
1,726
Posted By prismtx
Patern Match Question on file names
I have a script which I use to archive log files and I want to install it on another server. I match any file with a ".log" in the name. Most files end with ".log" or ".log.nnnn". Of course someone...
1,541
Posted By prismtx
Thanks
That worked after I removed the \ after $REF.

I had tried to do multiple -exec but could not get the code to recognize it correctly. Your solution worked great!

Thanks.
1,541
Posted By prismtx
Copy and Delete Question
I have a script to tar up some older files. It did a find and mv, but I had to change it to preserve the directory structure because some of the directories now have duplicate nameed files. I changed...
1,835
Posted By prismtx
But the directories that I am searching, have...
But the directories that I am searching, have both names in them and the find command finds them both flawlessly when I run it from the command line prompt. It is only in the ksh script that it...
1,835
Posted By prismtx
Find cmd not working correctly in script
I am trying to copy 2 types of files so I can archive them. I tested with a set of commands:
touch -t $(date -d "-60 day" +%Y%m%d) WORKDIR/REF
find TARGETDIR/ -type f -maxdepth 1 -iname \*.out\*...
14,276
Posted By prismtx
Thanks Franklin. I added a $ in front of the NF...
Thanks Franklin. I added a $ in front of the NF and it worked perfect!

DBNAME=`echo $LINE | awk -F= '{print $NF}'`
14,276
Posted By prismtx
How to find last delimiter in line?
I am working in a ksh script.

I am reading a login, password, and database name from a pre-existing config file. Login and password are simple, I take the value after the first "=" sign, but the...
14,010
Posted By prismtx
Thanks Tony. I'll check with my coworker on...
Thanks Tony. I'll check with my coworker on Monday. I haven't seen the script yet, just an email looking for help.
14,010
Posted By prismtx
Monitoring for a hung process
A coworker has a shell script that runs from a scheduler at the 3am. The shell script runs sqlplus passing in a sql statement, which generate a file. This is done 21 times for 21 different sql...
2,832
Posted By prismtx
Bypassing error in tar
I am tarring up a directory and then deleting the contents. I get a message that the file changed as tar was reading it, then my script fails on an error.

tar: /workdir/SRD.out.20080216: file...
5,675
Posted By prismtx
Found it!
sb008, thanks for your idea. The TZ didn't work on the SUSE Linux, but got me to explore in the right area and I found this solution which worked great for me.

touch -t $(date -d "-2 day"...
5,675
Posted By prismtx
Not working on all servers
sb008,
Your solution worked great on our Sun Solaris box, but some of the boxes are HP running SUSE Linux and it ignored the TZ command there.

Does anyone know a way to do that in SUSE Linux?
...
5,675
Posted By prismtx
List files created before Noon 2 days prior
Our nightly updates run in the evening and finish around 8am. My boss wants the current log files kept on the server for 2 days, but wants anything created before noon, 2 days prior archived. I was...
Showing results 1 to 24 of 24

 
All times are GMT -4. The time now is 02:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy