03-09-2009
Shell script for a writing the directory structure to a file
Hi All,
I am new user of shell scripting has come up with a problem. that I have a directory structure like :
Home
|
|--------A
| |----trunk
| |-------A_0_1/
| |
| |-------A_0_2/
|
|--------B
| |-----trunk
| |-------B_0_1/
| |
| |-------B_0_2/
|
|--------C
| |-----trunk
| |---------C_0_1/
My problem is to write a script that will generate a file reporting this file hierarchy i.e (The script can be run be from Home)
(Directiry structure states that under Home/ there are 3 subdirectories called A, B, C . Each has another subdirectory called trunk/, all trunk contains the versions of original directory like A_0_1, A_0_2, B_0_1...so on)
$ cat file
--------------
A/trunk/A_0_1
A/trunk/A_0_2
B/trunk/B_0_1
B/trunk/B_0_2
C/trunk/C_0_1
--------------
Please help me regarding this. Thanks in advance.
Last edited by bhaskar_m; 03-09-2009 at 02:02 AM..
Reason: to make the proper understanding of directory structure
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I'm a novice and I'd like to make a directory structure with a hundred or so folders. I've tried mkdir /foo/foo1/etc...
mkdir /foo/foo2/etc
mkdir /foo/foo3/etc
mkdir /foo/foo4/etc
...but it appends '@' to each folder name and then fails on the subdirectories. Is it better to use a... (2 Replies)
Discussion started by: kamur
2 Replies
2. 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
3. UNIX for Dummies Questions & Answers
how would i write a shell script to count number of one-line comments in a c++ file. please help with coding thank you. (1 Reply)
Discussion started by: deadleg
1 Replies
4. Shell Programming and Scripting
Hello Folks,
I want to get the results from a SQL query which needs to be exported to a .txt file.
My Script is something like
#!/bin/ksh
db2 connect to DATABASE user user_name using pwd;
touch test.txt
isResult=0;
isResult= `db2 -x select 'ABC',COL_B from TABLE_A WHERE COL_B=CONDITION`... (6 Replies)
Discussion started by: dinesh1985
6 Replies
5. Shell Programming and Scripting
I am trying to prompt the user using tput command to read the information ( 5 last names, first names and grades) from the keyboard. Save the data in a file called student.txt. Sort the file by last name and display it on the screen
My pseudocode is as follow:
Pseudocode:
Initialize... (1 Reply)
Discussion started by: jestaton
1 Replies
6. Shell Programming and Scripting
Hi all,
I have a shell script which I use to login to the server from the client and then from the server I run a bunch of other scripts to complete my task. I am having problems with the script below-
#!/bin/bash
while read line
do
connections=`echo $line | cut -d " " -f 1`
period=`echo... (3 Replies)
Discussion started by: joydeep4u
3 Replies
7. Shell Programming and Scripting
Can we create the master file that show the whole tree structure of the directory till a particular folder?
Database that contains four sub repository Sybase,sql,oracle,mysql and sql and oracle contains two subrepostories Siebel and plsql and each repositories contains three folders... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies
8. Shell Programming and Scripting
Hi All,
I have a script that does daily checks on my storage environment and is run from an AIX host.
The script currently works great but I have been changing and updating bits of it to make it easier for my lesser colleagues to understand :p
However now with the updates I have made I... (1 Reply)
Discussion started by: colinwilson1303
1 Replies
9. Shell Programming and Scripting
Hi,
facing an issue while calling sqlplus inside shell script. It for some reason goes to tmp file to write something and i get error as permission denied as i dont have access there.
ANy idea why sqlplus writes in /tmp and how to change or stop this ? (2 Replies)
Discussion started by: rushikeshs
2 Replies
10. Shell Programming and Scripting
I need a script which should watch a directory for a file with specific directory.
If it finds a file in directory, it should search for few specific keyword in the file. if the keyword exists, it should trim string from specific column.
The file should be moved to another directory and the a... (8 Replies)
Discussion started by: akashdeepak
8 Replies
LEARN ABOUT DEBIAN
svn-inject
SVN-INJECT(1) Command reference SVN-INJECT(1)
NAME
svn-inject - puts a Debian source package into Subversion repository
SYNOPSIS
svn-inject [options]
package.dsc
repository_URL
OPTIONS
svn-inject accepts the following options on the command-line:
-h
print the help menu
-v
Make the command output verbose
Default: Off.
-q
Hide less important messages
Default: Off.
-l
Layout type. 1 (default) means package/{trunk,tags,branches,...} scheme, 2 means the {trunk,tags,branches,...}/package scheme.
Default: 1
-t directory
Specify the directory where the .orig.tar.gz files are stored on the local machine.
Default: Off.
-d | --do-like=directory
Looks at the working directory of some other package and uses its base URL, tarball storage directory and similar checkout target
directory.
Default: Off.
-c number
Checkout nothing (0), trunk directory (1) or everything (2) when the work is done.
Default: 1
-o
Only keep modified files under SVN control (including the debian/ directory), track only parts of upstream branch
Default: Off.
-O | --no-branches
Do not create the branches subdirectory at all. This works in a similar way to -o but all changes on upstream files (e.g. meta changes
like updating the config.guess and config.sub files) are ignored and the upstream branch is not used.
Default: use branches/.
-s
By default, svn-inject used to create .svn/deb-layout after an inject operation if a checkout followed the inject. Since version 0.6.22
this behaviour is deprecated.
With this parameter svn-inject will replicate the old behaviour.
This option was provided since it can be useful when creating a local override file.
Default: Off.
-setprops -set-props
Set svn-bp:* props on the debian directory automatically.
Default: Off.
SEE ALSO
/usr/share/doc/svn-buildpackage/()
The svn-buildpackage HOWTO manual
svn-upgrade(1)
upgrade source package from a new upstream revision.
svn(1)
Subversion command line client tool
dpkg-buildpackage(1)
Debian source package tools
AUTHORS
Eduard Bloch
This manual page was written by Eduard Bloch in roff.
Goneri Le Bouder
Converted manpages to SGML.
Neil Williams
Converted manpages to DocBook XML and current Debian maintainer
COPYRIGHT
Copyright (C) 2009 Eduard Bloch
Release: 0.8.2 May 2009 SVN-INJECT(1)