How to avoid "override protection 644 (yes/no)?" -ksh 88


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to avoid "override protection 644 (yes/no)?" -ksh 88
# 1  
Old 11-11-2013
How to avoid "override protection 644 (yes/no)?" -ksh 88

Hi All,
I'm using Ksh 88 version.

I'm trying to remove the files using the below script .The code is working fine but i'm getting override protection 644 (yes/no)?
message for every file .. Pelase suggest
Code:
#!/usr/bin/ksh
set -x
File_Path="/etc/home/logs"
Dest_Path="/etc/home/temp"
days=60
file_nm="xx"

find $File_Path/*$file_nm* -type f -atime +$days -exec mv {} $Dest_Path \;
echo "Deleted The Files"

Upon executing the above script I'm getting the following Message. How can i avoid this message as I need to say "y" for all the files
Code:
mv: /etc/home/temp/xx11: override protection 644 (yes/no)?

please suggest me how can I avoid that message .

Thank You
# 2  
Old 11-11-2013
Change:
Code:
find $File_Path/*$file_nm* -type f -atime +$days -exec mv {} $Dest_Path \;

to:
Code:
find $File_Path/*$file_nm* -type f -atime +$days -exec mv -f {} $Dest_Path \;

This User Gave Thanks to Don Cragun For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to avoid rsync "The authenticity of host" prompt?

Hi, I wish to bypass the rsync prompt thus making the command non-interactive. Below is where it asks for prompt: rsync --delay-updates -F --compress --archive --rsh=/usr/share/bin/ssh /web/admin/Transfer/ user1@destserver.com:/tmp/test I tried the below two solution but... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. Shell Programming and Scripting

How to avoid the "temp files" in my script?

Hi ! :) I noticed that I create often of temporary files to keep character strings or other and I wish to avoid that if possible ? e.g : #!/bin/bash CONFIG_FILE="conf.cfg" TEMP_HOSTNAME="temp_file1.txt" for IP in `egrep -o '({1,3}\.){3}{1,3}' $CONFIG_FILE` do ssh "$IP"... (2 Replies)
Discussion started by: Arnaudh78
2 Replies

3. Shell Programming and Scripting

How to avoid "Too many arguments" error, when passing a long String literal as input to a command?

Hi, I am using awk here. Inside an awk script, I have a variable which contains a very long XML data in string format (500kb). I want to pass this data (as argument) to curl command using system function. But getting Too many arguments error due to length of string data(payloadBlock). I... (4 Replies)
Discussion started by: cool.aquarian
4 Replies

4. Solaris

How to avoid "cannot execute" issue with a runnable jar file?

I am trying to understand why the runnable jar file runs on one Unix server, but not the other with same environment settings. I copied exact same test jar from here --> http://www.javaworld.com/javaworld/javatips/javatip127/MakeJarRunnable.zip on to both Unix servers. Then changed... (5 Replies)
Discussion started by: kchinnam
5 Replies

5. Shell Programming and Scripting

Purpose of "read" and "$END$" in ksh ?

Hi, Could anyone please shed some light on the following script lines and what is it doing as it was written by an ex-administrator? cat $AMS/version|read a b verno d DBVer=$(/usr/bin/printf "%7s" $verno) I checked that the cat $AMS/version command returns following output: ... (10 Replies)
Discussion started by: dbadmin100
10 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

override protection 644 (yes/no)?

Hi pls help me out to short out this problem rm PAB113_011.out rm: PAB113_011.out: override protection 644 (yes/no)? n If i give y it remove the file. But i added the rm command as a part of ksh file and i tried to remove the file. Its not removing and the the file prompting as... (9 Replies)
Discussion started by: sri_aue
9 Replies

8. Shell Programming and Scripting

Joining 3 AWK scripts to avoid use "temp" files

Hi everyone, Looking for a suggestion to improve the below script in which I´ve been working. The thing is I have 3 separated AWK scripts that I need to apply over the inputfile, and for scripts (2) and (3) I have to use a "temp" file as their inputfile (inputfile_temp and inputfile_temp1... (2 Replies)
Discussion started by: cgkmal
2 Replies

9. HP-UX

script running with "ksh" dumping core but not with "sh"

Hi, I have small script written in korn shell. When it is called from different script, its dumping core, but no core dump when we run it standalone. And its not dumping core if we run the script using "/bin/sh" instead of "ksh" Can some body please help me how to resolve this issue. ... (9 Replies)
Discussion started by: simhe02
9 Replies

10. Shell Programming and Scripting

Avoid "++ requires lvalue" Error in Loop Calculation

Hi All, Please help me to perform sum of values in a loop, I am getting following error: "total=0++432907765772: ++ requires lvalue" where actual statement is as : total=$total+$amt where amt can have +ve or -ve values Thanks Sandeepb (3 Replies)
Discussion started by: sandeepb
3 Replies
Login or Register to Ask a Question