Sponsored Content
Top Forums Shell Programming and Scripting Generate class path dynamically based on source path Post 302987933 by oraclermanpt on Monday 19th of December 2016 03:27:54 PM
Old 12-19-2016
Generate class path dynamically based on source path

Hi experts,

I have multiple file names ending with .jsp located in
Code:
$SOME_DIR, $SOME_DIR/f1/,$SOME_DIR/f2/test,$SOME_DIR/f3/fa

and there are equivalent class files in
Code:
 $SOME_DIR/WEB-INF/classes/_pages,$SOME_DIR/WEB-INF/classes/_pages/_f1, $SOME_DIR/WEB-INF/classes/_pages/_f2/_test,$SOME_DIR/WEB-INF/classes/_pages/_f3/_fa

I have to write a script to match class file for each jsp file
ex:
Code:
Name: test.jsp 
Located in $SOME_DIR/f2/test
I have to check for _test.class in $SOME_DIR/WEB-INF/classes/_pages/_f2/_test (There is underscore in the path of the class)

if this class is not present then do something

I am doing find on $SOME_DIR for jsps and running basename on

Code:
for i in $( find $SOME_DIR -name '*.jsp'|  sed "s|$SOME_DIR/||;"); 
do 
echo jsp file $i
class_name==_$(echo $(basename $i)|cut -d'.' -f1).class
echo class name is $class_name
#now this _test.class file is present  in $SOME_DIR/WEB-INF/classes/_pages/_f2/_test
#$SOME_DIR/WEB-INF/classes/_pages directory or its sub directories is where all class files are present
done

Source of jsp is $SOME_DIR/f2/test
Destination of equivalent class is located in #$SOME_DIR/WEB-INF/classes/_pages/_f2/_test

logical code of destination path for a given .jsp will be $SOME_Dir+WEB_INF+classes+_pages+(dirname $i minus $SOME_DIR with underscore)

I am not really sure how to generate class path based on source path dynamically.

---------- Post updated 12-19-16 at 04:27 PM ---------- Previous update was 12-18-16 at 05:25 PM ----------

Resolved myself. I will post the solution...

Last edited by oraclermanpt; 12-18-2016 at 07:05 PM.. Reason: fixed spell mistakes
 

10 More Discussions You Might Find Interesting

1. Linux

rpmbuild, how to specify a different source and destination path for files

I'd like to specify a different build and deployment path for files, by default the same path is used for both build and install, I wasn't able to find a way to make these different. With Solaris pkgadd, one can specify different paths in prototype, so I would assume something like that is possible... (0 Replies)
Discussion started by: tiburblium
0 Replies

2. UNIX for Advanced & Expert Users

SCP wihout a source path

Hi, I hope someone can explain if this is the right behaviour. I regularly use scp to copy files between hosts like this: scp -prv user@remotehost:/path/to/copy . However, today, I made a mistake and typed this instead: scp -prv user@remotehost: /path/to/copy . This started copying... (6 Replies)
Discussion started by: zlowryder
6 Replies

3. UNIX for Dummies Questions & Answers

Source path

what is the command for moving a file with it's original source path ? (8 Replies)
Discussion started by: Oggie25
8 Replies

4. Shell Programming and Scripting

Generate a DML dynamically based off of header record

I have the following scenario where I need to use a header record from a file and generate a DML based off of it... E.g.: The header can change periodically with an additional column in between or remove a col.... Sample header : (head -1 sample.txt)... (17 Replies)
Discussion started by: anduzzi
17 Replies

5. Shell Programming and Scripting

Setting class path

hi , can anybody help me to chage the class path in unix server.. what are the files need to update .... (2 Replies)
Discussion started by: Madhu Siddula
2 Replies

6. Shell Programming and Scripting

Dynamically referencing a Path

How would I reference a source path (where I have a script pulling data from) that changes location? For example, a Mail folder is being used as a source to pull some data, but somebody could move the folder around in the GUI of Mail, changing it's location in the filesystem (that I am referencing... (11 Replies)
Discussion started by: sudo
11 Replies

7. Shell Programming and Scripting

Moving files from parent path to multiple child path using bash in efficient way

Hi All, Can you please provide some pointers to move files from Base path to multiple paths in efficient way.Folder Structure is already created. /Path/AdminUser/User1/1111/Reports/aaa.txt to /Path/User1/1111/Reports/aaa.txt /Path/AdminUser/User1/2222/Reports/bbb.txt to... (6 Replies)
Discussion started by: karthikgv417
6 Replies

8. Shell Programming and Scripting

I am trying to merge all csv files from source path into 1 file

I am trying to merge all csv files from source path into one single csv file in target. but getting error message: hadoop fs -cat /user/hive/warehouse/stage.db/PK_CLOUD_CHARGE/TCH-charge_*.csv > /user/hive/warehouse/stage.db/PK_CLOUD_CHARGE/final/TCH_pb_charge.csv getting error message:... (0 Replies)
Discussion started by: cplusplus1
0 Replies

9. Web Development

Path to javascript source code at local browsing

Where should I put my javascript source code in order to run it "locally" by file not by http?---not sure this "locally" is the appropriate word here. My test is when my javascript code (test.js) is put in the site default folder as the test.html in /var/www/html both worked as expected with... (2 Replies)
Discussion started by: yifangt
2 Replies

10. UNIX for Advanced & Expert Users

Command to see the logical volume path, device mapper path and its corresponding dm device path

Currently I am using this laborious command lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}' Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Discussion started by: royalibrahim
2 Replies
PAPS(1) 						      General Commands Manual							   PAPS(1)

NAME
paps - UTF-8 to PostScript converter using Pango SYNOPSIS
paps [options] files... DESCRIPTION
paps reads a UTF-8 encoded file and generates a PostScript language rendering of the file. The rendering is done by creating outline curves through the pango ft2 backend. OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. --landscape Landscape output. Default is portrait. --columns=cl Number of columns output. Default is 1. --font=desc Set the font description. Default is Monospace 12. --rtl Do rtl layout. --paper ps Choose paper size. Known paper sizes are legal, letter, a4. Default is A4. --bottom-margin=bm Set bottom margin in postscript points (1/72 inch). Default is 36. --top-margin=tm Set top margin. Default is 36. --left-margin=lm Set left margin. Default is 36. --right-margin=rm Set right margin. Default is 36. --help Show summary of options. --header Draw page header for each page. --markup Interpret the text as pango markup. --encoding=ENCODING Assume the documentation encoding is ENCODING. --lpi Set the lines per inch. This determines the line spacing. --cpi Set the characters per inch. This is an alternative method of specifying the font size. --stretch-chars Indicates that characters should be stretched in the y-direction to fill up their vertical space. This is similar to the texttops behaviour. AUTHOR
paps was written by Dov Grobgeld <dov.grobgeld@gmail.com>. This manual page was written by Lior Kaplan <kaplan@debian.org>, for the Debian project (but may be used by others). April 17, 2006 PAPS(1)
All times are GMT -4. The time now is 07:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy