Hi,
I am trying to get the following output:
-(0)
/home/<user-name>-(1)
..........a-(2)
....................codetest-(3)
..............................oracle-(4)
..............................unix-(5)
........................................dir1-(6)
....................meum-(7)
....................oracle-(8)
..............................plcourse-(9)
..............................sqlcourse-(10)
........................................exercises-(11)
..................................................chapter10-(12)
..................................................chapter11-(13)
..................................................chapter12-(14)
The example above shows that directly under the home directory, there is a single directory ‘a’ which contains ‘codetest’, ‘meum’ and ‘oracle’. Under ‘codetest’ there is ‘oracle’ and ‘unix’.
and I am using the following code:
################
When the recursion takes place in function subDir, it doesn't restore the previous values after coming out.e.g
if it has found and displayed the dir1-(6) from the desired output, it will not regain the values of unix(5) or codetest(3)..
Can anybody help please.
Regards,
Qasim
Last edited by qasim; 08-04-2009 at 06:23 AM..
Reason: indent
That's lovely.Thank you very much.
I 'll really appreciate if somebody would let me know what's wrong with my code (so i could improve my scripting skills)
Regards,
Qasim
That's lovely.Thank you very much.
I 'll really appreciate if somebody would let me know what's wrong with my code (so i could improve my scripting skills)
Regards,
Qasim
Try declaring the variables used by the function to be local
How can I find and print the directories on a server that have more than 5,000 files? There's some spam emails and I'm trying to find all directories that have a lot of spam
The file count should just be the files directly under that directory, not like the total from all nested directories
... (1 Reply)
Hello all!
I'm looking to list directories and sub-directories of a path, on this forum I found this command:
find $path -type d -exec ls -ld {} \;
The issue I have is that with a simple ls, the list is listed by name, and using -t I get it by time.
How could I list directories and sub... (5 Replies)
Hi
When im listing (ls -al ) its listing directories without / at the end of directories
dir1 dir2 dir3
and i need to list directories with
dir1/ dir2/ dir3/ and this should not be made by command ls -F
/ should be embedded at the last
since one of the scripts reads... (10 Replies)
Hi
When im listing (ls -al ) its listing directories without / at the end of directories
dir1 dir2 dir3
and i need to list directories with
dir1/ dir2/ dir3/ and this should not be made by command ls -F
/ should be embedded at the last
since one of the scripts reads directories... (1 Reply)
Hey there, i am trying to list all the directories and sub directories of a file system, but am having a bit of trouble.
ls -lR|grep \/|grep '^\.' >> input.dat
i used this statement to list all the directories and sub directories and output them to a file
when i try to print them out on... (3 Replies)
Hi,
Simple question.
If i could find a file been listed in many dirctories, how to get the unique list of directories.
find / -name "abc*" --> will give me list of directories.
/home/abc.txt
/home/ddd/abcd.txt
/home/ddd/abcde/txt
So how to get
/home
/home/ddd
Thanks in... (2 Replies)
Hi
I have 2 questions:
Q1 - What does
${1:+$1/}*
mean? I guess it lists all files in current directory - Could any one explain how this expression works?
Q2 - I am trying to list directories only in current path - I know that ls could be used but I thought I'd give find a try. I need to... (5 Replies)