The UNIX and Linux Forums  

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
Passing global variable to a function which is called by another function sars Shell Programming and Scripting 4 06-30-2008 08:39 AM
function help coolkid Shell Programming and Scripting 2 05-01-2008 10:47 AM
Log function Ernst Shell Programming and Scripting 17 03-19-2007 09:31 AM
awk with function ?? please, help :( sabercats Shell Programming and Scripting 0 03-13-2006 04:52 PM
How to convert the "select" function into a "poll" function rbolante High Level Programming 1 07-10-2001 07:49 AM

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

Join Date: Sep 2006
Posts: 8
Function within function (Recurance)

Slight prob with the placement of func in func
Just to list directories within directories
The func below will only list the first set of dir after home dir
I need it to list below anyother dir within that dir
function ListDir (){
for list in $(ls $1)
do
if [ -d $1/$list ]
then
echo $list
fi
done
}
ListDir $HOME

Thanx
Reply With Quote
Forum Sponsor
  #2  
Old 09-19-2006
Dhruva's Avatar
Registered User
 

Join Date: Mar 2006
Location: India
Posts: 255
is it necessary to make function.i mean the same task can be done with find command
Code:
path=/export/home/abc/xyz
find $path -type d -print
or
Code:
find /export/abc/yourpath -type d -print
Reply With Quote
  #3  
Old 09-19-2006
Registered User
 

Join Date: Sep 2006
Posts: 8
silly me

i used

ListDir $1/$list

which looked for dir within dir
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 04:11 AM.


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