![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Transfer files wih directory structure. | uxlunatick | SCO | 11 | 04-28-2008 03:25 PM |
| Recursion to Copy a Directory structure | avrkiran | Shell Programming and Scripting | 2 | 03-31-2008 02:43 AM |
| Copying with directory structure | Cnfsed | UNIX for Dummies Questions & Answers | 4 | 11-29-2007 12:51 AM |
| MV files from one directory structure(multiple level) to other directory structure | srmadab | UNIX for Advanced & Expert Users | 4 | 09-13-2006 04:01 PM |
| Copying a Directory Structure to a new structure | jhansrod | UNIX for Dummies Questions & Answers | 8 | 07-27-2005 06:24 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Need help in Directory Structure
I have writen the following code to show the dirctory structure. Can any body help me for using the recursive function in this code?
echo "-(0)" echo "$HOME-(1)" cd ~ set * for i in `ls $HOME` do if [ -d "${i}" ] then echo ".....${i}" cd $HOME/${i} set * for j in `ls $HOME/${i}` do if [ -d "${j}" ] then echo "..........${j}" cd $HOME/${i}/${j} set * for k in `ls $HOME/${i}/${j}` do if [ -d "${k}" ] then echo "................${k}" else echo -n "" fi done else echo -n "" fi done else echo -n "" fi cd ~ set * done Thanks in advance. |
|
||||
|
Thank u very much for giving me a nice simple solution. But can you give me the hint for the outputf format. e.g
$HOME .........aaa ...............aaa1 ................aaa2 ........................aaa21 Thanks for interest and help. |
|
|||||
|
Care to search the forum ? Try printing directories
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|