Sponsored Content
Top Forums Shell Programming and Scripting printing a directory structure Post 302495840 by rocker_me2002 on Friday 11th of February 2011 10:32:18 AM
Old 02-11-2011
printing a directory structure

Hey everyone

I am just trying print a directory structure but I am not getting the desired output.

I am using AIX.

Script :

input file contains : TNP\\ECOM\\test\\1


Code:
input_file=folders.txt
cat $input_file | while read line
do
echo $line
done


Output:

Code:
TNF\ECOM        est\1


Expected output:
Code:
TNP\ECOM\test\1


any help?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replacing characters in a directory structure

I have a directory structure that contains "()". I need to recursivly replace the "(" with an "_" and remove the ")". Can I write a script to: Read -R C:\VCE If "(" exitsts replace with "_" elseif ")" exists, delete. (4 Replies)
Discussion started by: tmettie
4 Replies

2. UNIX for Dummies Questions & Answers

Copying a Directory Structure to a new structure

Hi all Is it possible to copy a structure of a directory only. e.g. I have a file with the following entries that is a result of a find :- /dir1/dir2/file.dbf /dir1/dir2/dir3/file1.dbf /dir1/file.dbf I want to copy these to a directory and keep the structure however starting at a new dir... (8 Replies)
Discussion started by: jhansrod
8 Replies

3. UNIX for Advanced & Expert Users

MV files from one directory structure(multiple level) to other directory structure

Hi, I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies

4. UNIX for Dummies Questions & Answers

copy files with directory structure

i have a text file as. /database/sp/NTR_Update_Imsi_List.sql /database/sp/NTR_Update_Imsi_Range_List.sql /database/sp/NTR_Vlr_Upload.sql /database/tables/StatsTables.sql /mib/ntr.mib /mib/ntr.v2.mib /scripts/operations/ntr/IMSITracer.ph /scripts/operations/ntr/IMSITracer.pl ... (3 Replies)
Discussion started by: adddy
3 Replies

5. Shell Programming and Scripting

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 then echo ".....${i}" cd... (5 Replies)
Discussion started by: murtaza
5 Replies

6. UNIX for Dummies Questions & Answers

Copying with directory structure

Hi, I need to copy a set of directories along with all sub directories and files from one unix box to another. Any ideas? cnfsed (4 Replies)
Discussion started by: Cnfsed
4 Replies

7. UNIX for Dummies Questions & Answers

Directory Structure

Hi... I have a directory which has multiple directories and sub directories inside... what command should i use to get a list of all these directories, without the filenames.... (2 Replies)
Discussion started by: saharookiedba
2 Replies

8. Solaris

Question about directory structure

I have a Solaris 9 system and was trying to familiarize myself with how the filesystem is laid out. I was wondering what the following directories were for (legacy, some administrative reason, etc) The reason I ask about these specific directories is that they have executables with the... (4 Replies)
Discussion started by: thmnetwork
4 Replies

9. Shell Programming and Scripting

Create Directory structure

Hello ; ) again Now I have my file like this : DIR2/DIR3 DIR2 DIR2/DIR3/DIR4/DIR5 I am looking for help to create a loop that will create the directory structure. I need something like this : If "DIR2" does not exist > Create IF "DIR2" exist already > check if onther "DIR"... (5 Replies)
Discussion started by: Aswex
5 Replies
dirent(5)							File Formats Manual							 dirent(5)

NAME
dirent.h - format of directory streams and directory entries SYNOPSIS
DESCRIPTION
This header file defines data types used by the directory stream routines described in directory(3C). The following data types are defined: A structure containing information about an open directory stream. A structure defining the format of entries returned by the function (see directory(3C)). The structure includes the following members: char d_name[MAXNAMLEN+1]; /* name of directory entry */ ino_t d_ino; /* file serial number */ short d_namlen; /* length of string in d_name */ short d_reclen; /* length of this record */ The constant is defined in Note that the entry is used internally to represent the offset from the current entry to the next valid entry. Therefore, is not the length of the current entry, but the length of the current record where a record is an entry plus any currently unused space between the current entry and the next valid entry. The unused space between valid entries results from changes in a directory's contents, such as the deletion of files and other directories. This file also contains external declarations for the functions that perform directory operations (see directory(3C)). WARNINGS
For 32-bit applications, the d_ino field may overflow for filesystems that use 64-bit values. In this case, the most-significant bytes will be truncated without error, and the value may not be unique. AUTHOR
was developed by AT&T and HP. SEE ALSO
directory(3C). STANDARDS CONFORMANCE
dirent(5)
All times are GMT -4. The time now is 05:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy