03-31-2008
Recursion to Copy a Directory structure
Thanks for your inputs. Yes, am new to shell scripting. The srcDir and destDir variables are working fine now. But still the recursion control variable J is behaving like a Global variable. How do i make "J" as a local variable so that there are copies of the variable J created in every call to createelement? Pls. let me know. Tried "typeset j=0" as the first line of the file but doesn't seem to work.
Last edited by avrkiran; 03-31-2008 at 03:58 AM..
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I want to copy the durectory structure having subdirectories in it ... would be greatful if anyone could let me know ..
thanks in advance (6 Replies)
Discussion started by: myelvis
6 Replies
2. UNIX for Dummies Questions & Answers
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
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
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
I am trying to write a script which has to copy the directory structure from my system to another system on the network. But I dont want the files to be copied.
I think I have to start with copying all subdirectories names in a directory to a system on the network.
Here's the case:
Source... (1 Reply)
Discussion started by: firefox211
1 Replies
6. Shell Programming and Scripting
Hello All,
I have got a dev server and a production server will call it as D server and P server.
I have a dir structure in my D server and i need to create the same dir structure in P server also using a shell script.
If i do a find . in my D server, i am getting an o/p like :-
.
./vio... (9 Replies)
Discussion started by: Renjesh
9 Replies
7. Programming
Hi ,
I have a scenario where i need to copy the iter to another local variable , where iter is of type MCC_T_SYS_ADDRINFO *iter .
struct addrinfo {
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
... (5 Replies)
Discussion started by: breezevinay
5 Replies
8. Shell Programming and Scripting
Hope the title is close enough; didn't quite know how to put this...
OK.
We have a hypothetical script, script.a, with one simplistic line:bash ./nextDir/script.bNow script.b has a bit more going for it; and does file moves, copies, and renames, calling all the targets with respect to itself.... (7 Replies)
Discussion started by: LinQ
7 Replies
9. UNIX for Beginners Questions & Answers
Hi,
I cannot find a way to copy a directory to another location with all attributes (mode, ownership, timestamps) but withOUT recursion (after so many years of working with Linux).
Say I want to create /home/jail/tmp exactly like /tmp but with nothing in it. Here is what I tried:
... (7 Replies)
Discussion started by: chebarbudo
7 Replies
HFS(1) General Commands Manual HFS(1)
NAME
hfs - shell for manipulating HFS volumes
SYNOPSIS
hfs [hfs-path [partition-no]]
DESCRIPTION
hfs is an interactive command-oriented tool for manipulating HFS volumes. hfs is based on the Tcl interpreter, so basic Tcl constructs can
be used in addition to the following commands:
mount path [partition-no]
The specified UNIX path is opened as an HFS volume. If a partition number n is specified and the volume source is located on a par-
titioned medium, the nth discovered HFS partition will be mounted. The default partition-no is 1.
umount [path]
The volume previously mounted from the specified path (or the current volume, if none specified) is unmounted.
vol path
The volume previously mounted from the specified path is made current.
info General information about the currently mounted volume is displayed. This information is also displayed automatically when the vol-
ume is mounted.
pwd The full path to the current working HFS directory is displayed.
cd [hfs-path]
The current working directory is changed to the given HFS path. If no path is given, the working directory is changed to the root of
the volume.
dir [hfs-path]
A directory listing of the specified HFS directory is displayed. If no path is given, the contents of the current working directory
are shown.
mkdir hfs-path
A new, empty directory is created with the specified path.
rmdir hfs-path
The specified directory is removed. It must be empty.
create hfs-path [type [creator]]
An empty file is created with the specified path. The Macintosh type and creator may be specified, or they will default to TEXT and
UNIX, respectively.
del hfs-path
Both forks of the specified file are deleted.
stat hfs-path
Status information about the specified HFS path-identified entity is displayed.
cat hfs-path
The data fork of the specified HFS file is displayed.
copyin unix-path [hfs-path [mode]]
The specified UNIX file is copied to the named HFS destination path. Unless specified otherwise, the file will be copied into the
current HFS working directory using a heuristically chosen mode. The mode may be one of: macb (MacBinary II), binh (BinHex), text,
or raw.
copyout hfs-path [unix-path [mode]]
The specified HFS file is copied into the named UNIX destination path. Unless specified otherwise, the file will be copied into the
current UNIX working directory using a heuristically chosen mode. The modes are the same as for copyin.
format path [partition-no [volume-name]]
The specified UNIX path is initialized as an empty HFS volume with the given name, and this volume is subsequently mounted. The
default volume name is Untitled.
The shell is scriptable, however it should be understood that the above commands are actually implemented by Tcl procedures prefixed with
the character "h", e.g. hmount, hcd, etc., in order to avoid name collisions with other Tcl utilities. The "h" may be omitted in interac-
tive use for convenience.
SEE ALSO
hfsutils(1), xhfs(1)
BUGS
cat can only display the data fork of a file. Text translations are performed unconditionally on the output. Furthermore, binary data can-
not be handled properly from within Tcl scripts since the character with value 0 cannot be represented in Tcl strings. Use copyout to copy
files without these limitations.
AUTHOR
Robert Leslie <rob@mars.org>
HFSUTILS
15-Jan-1997 HFS(1)