Sponsored Content
Top Forums Shell Programming and Scripting Run SED for all index.jsp files across a directory structure. Post 302453151 by rdcwayx on Tuesday 14th of September 2010 07:30:17 AM
Old 09-14-2010
Code:
source=/XXX/XXX
cd $source

for file $(find . -name index.jsp -type f)
do
  DIR=$(dirname $file)    # rule 1. DIR is the file's path.
  sed -n -e 's/^.*page="\([^"]*\).*$/\1/p' $file  # rule 2 
  # do something
done

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

disk space used for files with in a directory structure.

Hello, I am new to shell scripting and would really appreciate if someone could help me with this question. I have a directory structure as follows.. main directory is DATA under which i have different directories names fileserver01, fileserver02 ... till fileserver 15. under each... (8 Replies)
Discussion started by: kasala
8 Replies

2. 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

3. 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

4. SCO

Transfer files wih directory structure.

I need to transfer software off a SCO OpenServer 5.0.5 server. I can not seem to read this server's tape on my other server since the tape drive (IBM Gen 5 DAT 72GB) will continuosly "eject" this DAT 8 tape. I have been able to 'tarball' most of the smaller directories with success and... (11 Replies)
Discussion started by: uxlunatick
11 Replies

5. Shell Programming and Scripting

Script to run a command on all txt files present in a dir structure

Hi, I have a directory structure like the one given below root\a\b1 root\a\b2 root\b\b1 root\b\b2 . . . root\j\b1 root\j\b2 Now, there are a txt files in each dir and subdir, there is a root.txt I have to write a script where in i have to run a command called "genrb <filename>"... (6 Replies)
Discussion started by: vikramsinghnegi
6 Replies

6. Shell Programming and Scripting

Copying a directory structure with the latest versions of files

Hello I have three directory structures for code releases. Each directory structure looks like this: bash-3.00$ ls -R | more .: Test_Release_1 Test_Release_2 Test_Release_3 ./Test_Release_1/dbcode: rp_online_import_srdp.pkb-1 srdp_ar_validation.pkb-1... (1 Reply)
Discussion started by: Glyn_Mo
1 Replies

7. Shell Programming and Scripting

How to traverse directory structure and sum size of files?

How do I write a bash or ruby or perl or groovy script to print all the files in my directory tree that are one-to-two years old, the size of each file, and the sum of file sizes and then delete them? I was using find . -atime +365 -exec rm '{}' \; but the problem was that I could not... (5 Replies)
Discussion started by: siegfried
5 Replies

8. Shell Programming and Scripting

Extract files from tar ball without directory structure

Hi, I have tar filw which has multiple directories which contain files. When i extract using tar -xf the directory structure also get extracted. I require only files and not directory structures as there will be overhead of moving the files again. So i searched here and got a solution but... (4 Replies)
Discussion started by: chetan.c
4 Replies

9. Shell Programming and Scripting

Archiving files keeping the same structure directory

Hello Team, We would like to backup a lot of files inside of a structure of directories, four, five or more levels in some Ubuntu, Mac and Solaris systems. For instance: /home/chuck/sales/virgin/rent-quote.pdf /home/chuck/sales/marriott/vacation-quote.pdf... (2 Replies)
Discussion started by: csierra
2 Replies
FSINFO(8)						      System Manager's Manual							 FSINFO(8)

NAME
fsinfo - coordinate site-wide filesystem information SYNOPSIS
fsinfo [ -v ] [ -a autodir ] [ -b bootparams ] [ -d dumpsets ] [ -e exports ] [ -f fstabs ] [ -h hostname ] [ -m automounts ] [ -I dir ] [ -D string[=string] ] [ -U string[=string] ] config ... DESCRIPTION
The fsinfo utility takes a set of system configuration information, and generates a coordinated set of amd , mount and mountd configuration files. The fsinfo command is fully described in the document Amd - The 4.4BSD Automounter SEE ALSO
amd(8), mount(8), mountd(8). ``am-utils'' info(1) entry. Linux NFS and Automounter Administration by Erez Zadok, ISBN 0-7821-2739-8, (Sybex, 2001). http://www.am-utils.org Amd - The 4.4 BSD Automounter HISTORY
The fsinfo command first appeared in 4.4BSD. AUTHORS
Jan-Simon Pendry <jsp@doc.ic.ac.uk>, Department of Computing, Imperial College, London, UK. Erez Zadok <ezk@cs.sunysb.edu>, Computer Science Department, Stony Brook University, Stony Brook, New York, USA. Other authors and contributors to am-utils are listed in the AUTHORS file distributed with am-utils. June 28, 1993 FSINFO(8)
All times are GMT -4. The time now is 06:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy