First, when you select "*log*", you don't have to select "*.log*" beacause they are already in the first selection !
Second, why "touching" the file before deleting it ?
Third, your script will be runnig with "unable to remove file xxx" beacause of the command "rm -f $filestodelete" that will delete all the files selected by "for files in (*log*|*.log*)"
First, when you select "*log*", you don't have to select "*.log*" beacause they are already in the first selection !
Second, why "touching" the file before deleting it ?
Third, your script will be runnig with "unable to remove file xxx" beacause of the command "rm -f $filestodelete" that will delete all the files selected by "for files in (*log*|*.log*)"
So, I propose you the script :
you gave me good suggestions.Thanks..
i have to touch the file because we have some processes running that need to pick that blank file otherwise we need to restart the aaplication again if i deleted the file without touching it.cp will unnecessarily increase the size.
i have to touch the file because we have some processes running that need to pick that blank file otherwise we need to restart the aaplication again if i deleted the file without touching it.cp will unnecessarily increase the size.
What about moving the file and touching a new one:
but i got a problem here-- my script is like this--
here it will touch the file again and again and appending the day after the file name again like->
ansrpt26529.log.Fri.Fri.Fri.Fri
but i do not want it like that.
i have to take backup of the file.then touch it and delete the file.
the pattern matching for the files to delete is
list=$(ls *log*)
it is selecting all the files ansrpt26529.log.Fri.Fri.Fri.Fri like this but i do not want it like this it sould be only ansrpt26529.log.Fri.
pattern matching may be diffrent here so give me some suggestions to solve this problem.
Last edited by namishtiwari; 01-25-2008 at 12:41 PM..
Hi all,
a problem with a loop. Imagine it starts with
var1="$(cat txtif.out )"while
do
echo file1
echo file2
echo y > txtif.out
if
then
break
fi
done
exit 0
the problem is that if the file is changing during the loop seems to continue as it reads "x" state,... (5 Replies)
I am trying to do a while do loop that asks for a password and returns if the password entered is incorrect. I have that part working however i want to modify it so that if a similar word is entered it will read "that is close but incorrect" and i cannot seem to get it working, being new in the... (6 Replies)
Hi,
I work on Ab-initio ETL tool which is based on Unix. I made a small script which has two loop's one with in another. All the functionality is working for the first line of outer loop but when it comes to other lines of outer loop it is throwing error as command not found. Below is the... (4 Replies)
Hi Script Gurus,
I am facing issue with while loop in bash. The while loop is running as end less loop even after given criteria does not meet.
STATE_BEFORE_SPLIT () {
for clone in $Clonegroups; do
state=$( $Navicmd -listclone -name $clone -cloneid $Cloneid |awk... (3 Replies)
I have a while loop with -f and -o option.Can any one please tell me what that stands for?The Sample code is as follows:-
while
do
## some processing
done (10 Replies)
hi
I had created a while loop in a script file called whiletest.sh as follows
as follows:
count=0
max=10
while
do
echo $count
echo count=$(count+1)" "
done
echo "value of count:$count"
then i run the script with the command
sh whilestest.sh
but its giving me an error... (5 Replies)
Hi
What is wrong with this loop
it was taken has a example in book!!!
it returns
then
/usr/sbin/svcadm disable ppserv
else /usr/sbin/ppadmin stop
fi
} (3 Replies)
Hi Guys,
This is my code.. I am getting an error in the inside while statement when comparing.. I am not able to figure it out.. Pls help me...
while read value fatherid son_id top_id r_type
do
inside_value=1;
echo $inside_value;
echo $r_type;
while
do
echo... (6 Replies)
Hi guys my while do loop is not working properly;
As soon as the load_date and run_date is same it should stop can somebody tell me where I am having the problem?
In an oracle table I have
LOAD_DT=5/1/2009 DATE datatype
RUN_DT=5/5/2009 DATE datatype
Now in a script with a spool file I get the... (15 Replies)
hi all,
i have written the following code:
while(proceed !='Y' && proceed!='N' && proceed!='y' && proceed!='n')
{
printf("\nPress \n\t 'Y' or 'y' to continue \n\t 'N' or 'n' to cancel:");
scanf("%c",&proceed);
}
the output i am gettin is:
Press
'Y' to continue
... (1 Reply)