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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-29-2006
debasis.mishra debasis.mishra is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 22
-d

why we use -d in script?
  #2 (permalink)  
Old 03-29-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Quote:
Originally Posted by debasis.mishra
why we use -d in script?
-d can be used for so many things. Unless you show us the code snippet, it is hard to give a definitive answer.

Guessing... look into man test to see about -d.
  #3 (permalink)  
Old 03-29-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Where is this -d being used? Is it for a particular command? If so, then check the man page for that command.
  #4 (permalink)  
Old 03-29-2006
debasis.mishra debasis.mishra is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 22
reply about -d

Actually my friend using the -d in this code.

if [ -d $LOG_DIR ]
then
cd $LOG_DIR
echo $LOG_DIR >> $LOG_FILE
find . \( -name '*.log*' -type f \) -mtime +30 -exec rm -f {} \;
fi
  #5 (permalink)  
Old 03-29-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
As I said ealier, look into man test to see the description about -d
  #6 (permalink)  
Old 03-29-2006
debasis.mishra debasis.mishra is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 22
i got the solution.thanks
  #7 (permalink)  
Old 03-29-2006
debasis.mishra debasis.mishra is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 22
will u tell me what is this meaning?

find . \( -name '*.log*' -type f \) -mtime +30 -exec rm -f {} \;

What it will search the file which is less than 30 minutes?
Closed Thread

Bookmarks

Tags
mtime

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 08:56 PM.


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