The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
c shell script help with find bigboizvince Shell Programming and Scripting 1 03-25-2008 12:49 PM
Help - shell script newbie eback Shell Programming and Scripting 2 10-15-2007 02:28 PM
A few questions from a newbie(shell script) perk_bud Shell Programming and Scripting 5 07-21-2007 02:59 AM
shell script to find files naren_samba2005 Shell Programming and Scripting 2 10-21-2005 02:06 AM
Newbie using sed in a shell script ktoz Shell Programming and Scripting 1 05-26-2003 02:07 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-29-2006
Registered User
 

Join Date: Jun 2006
Posts: 5
NEWBIE: If and Find in shell script

Basically I have a shell script and i want to search the computer for a folder and if that folder exists i want to take some action. Not sure exactly how to do this most efficiently.

Not very experienced....any help would be appreciated.
Reply With Quote
Forum Sponsor
  #2  
Old 06-29-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,698
Code:
found=$(find / -type d -name "folder.name" 2> /dev/null)
if [ ! -z $found ] ; then
  # your action
fi ;
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:43 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0