The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sed and awk backslash characters potro Shell Programming and Scripting 7 05-19-2008 08:34 AM
How ro handle backslash character in grep? rajbal Shell Programming and Scripting 1 06-18-2007 08:19 PM
ignoring backslash while executing command agalkin Shell Programming and Scripting 6 11-16-2005 06:04 PM
backslash issues Bab00shka UNIX for Dummies Questions & Answers 5 07-09-2004 08:53 AM
Adding a backslash to users' input netguy Shell Programming and Scripting 13 04-30-2004 05:06 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-24-2008
findprakash findprakash is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 31
Backslash in find command

When I run my script in debug mode I see that \ is not getting executed as part of command. It is being treated as escape character.

find ${DATABASE_PARAM_PATH} -mtime +${RETENTION_PERIOD} -exec rm -rf {} \;

Command execution output in debug mode :

find /pgmfgfpws/app/oracle/mfgfpwsdb/10.2.0/admin/mfgfpws_webisstg70/bdump -mtime +1 -exec ls -ltr {} ;

Backslash is missing. Without blackslash if bdump directory is empty after deleting all files which meet deletion criterion, find command deletes bdump directory as well. I don't want bdump directory to be deleted even though it is empty.

I have tried escaping backslash as below but it doesn't work :

find ${DATABASE_PARAM_PATH} -mtime +${RETENTION_PERIOD} -exec rm -rf {} \\;

Same command works fine when run from command line.
Any help is greatly appreciated.
  #2 (permalink)  
Old 08-24-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
See find command Help!! where you asked the same question. Thanks.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0