hi frnds,
I have written a script as follows.
ssh username@servername "find $1 -type f -name $2 -mtime +1 -exec rm '{}' \;"
when i excute tis script i get error
FIND: Parameter format not correct
parameter 2 is the file name .. .
Thx in advance
hi frnds,
I have written a script as follows.
ssh username@servername "find $1 -type f -name $2 -mtime +1 -exec rm '{}' \;"
when i excute tis script i get error
FIND: Parameter format not correct
parameter 2 is the file name .. .
Thx in advance
guess #1 You are using a glob patter for name and it is being incorrectly expanded due to the way you are quoting the expression.
try:
"find $1 -type f -name \"$2\" -mtime +1 -exec rm '{}' \;"
Thanx a lot ..
but i am still facing the error ..any more guess
thx
--------------------------------------------------------------------------------
"/bin/find $1 -type f -name \"$2\" -mtime +1 -exec rm '{}' \;"
Thanx reborg
but i solved it ....
i am using ssh to contect to remote server ... and then find files and delete them...
Reborgs command is working for me. also this one is working for me in ksh:
find $1 -type f -name "$2" -mtime +1 -exec rm '{}' \;
My command is only becasue of the use of SSH to run this without the ssh the additional escaping should not be needed.
what difference does a secure shell make for additional escaping?