Sponsored Content
Top Forums Shell Programming and Scripting Pattern match a path anywhere in the line and replace it with new path Post 302947928 by kchinnam on Wednesday 24th of June 2015 03:30:31 AM
Old 06-24-2015
Pattern match a path anywhere in the line and replace it with new path

I want to pattern match only path part from below and replace them with new path string.
Code:
LoadModule jk_module /fldrA/fldrBaf/fldrCaa/modules/mod_jk.so

JkWorkersFile /fldrA/fldrBaf/fldrCaa/config/OHS/ohs1/workers.properties

JkLogFile /fldrA/fldrBaf/fldrCaa/diagnostics/logs/OHS/ohs1/mod_jk.log

paths(ex:/fldrA/fldrBaf/fldrCaa) from above will be dynamic. How do I do that?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed - Replace Line which contains the Pattern match with a new line

I need to replace the line containing "STAGE_DB" with the line "STAGE_DB $DB # database that contains the table being loaded ($workingDB)" Here $DB is passed during the runtime. How can I do this? Thanks, Kousikan (2 Replies)
Discussion started by: kousikan
2 Replies

2. Shell Programming and Scripting

search pattern and replace x-y characters in nth line after every match

Hi, I am looking for any script which can do the following. have to read a pattern from fileA and copy it to fileB. fileA: ... ... Header ... ... ..p1 ... ... fileB: .... .... Header (3 Replies)
Discussion started by: anilvk
3 Replies

3. Linux

Replace new line with path

Hi, The below is the output of multipath -ll |grep -i ddn | awk '{print $1}' | tr -s '\n' ',': /dev/mapper # multipath -ll |grep -i ddn | awk '{print $1}' | tr -s '\n' ','... (2 Replies)
Discussion started by: teav
2 Replies

4. Shell Programming and Scripting

pattern match and replace another pattern in same line

I have a pattern username:x:32005:32006::/usr/local/user:/bin/bash I need to match the line containing username and replace /bin/bash with /usr/local/my/bin/noshell So it becomes username:x:32005:32006::/usr/local/user:/usr/local/my/bin/noshell (7 Replies)
Discussion started by: anilcliff
7 Replies

5. Shell Programming and Scripting

Help with replace line based on specific pattern match

Input file data20714 7327 7366 detail data20714 7327 7366 main data250821 56532 57634 detail data250821 57527 57634 main data250821 57359 57474 main data250821 57212 57301 main data250821 57140 57159 detail data250821 56834 57082 main data250821 56708 56779 main ... (3 Replies)
Discussion started by: perl_beginner
3 Replies

6. Shell Programming and Scripting

I need to know how to replace a line after a pattern match with an empty line using SED

Hi How Are you? I am doing fine! I need to go now? I will see you tomorrow! Basically I need to replace the entire line containing "doing" with a blank line: I need to the following output: Hi How Are you? I need to go now? I will see you tomorrow! Thanks in advance.... (1 Reply)
Discussion started by: sags007_99
1 Replies

7. Shell Programming and Scripting

Rearrange or replace only the second line after pattern match or pattern match

Im using the command below , but thats not the output that i want. it only prints the odd and even numbers. awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}' Im hoping for something like this file1: Text hi this is just a test text1 text2 text3 text4 text5 text6 Text hi... (2 Replies)
Discussion started by: invinzin21
2 Replies

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

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

10. Shell Programming and Scripting

Find and replace the path value in files, pattern is not full known.

Hi, I need to do find and replace, but the pattern is not full known. for example, my file has /proj/app-d1/sun or /data/site-d1/conf here app-d1 and site-d1 is not constant. It may be different in different files. common part is /proj/xx/sun and /data/xxx/conf i want to find where ever... (6 Replies)
Discussion started by: rbalaj16
6 Replies
Gnome2::Config(3pm)					User Contributed Perl Documentation				       Gnome2::Config(3pm)

NAME
Gnome2::Config METHODS
boolean = Gnome2::Config->get_bool ($path) o $path (string) boolean = Gnome2::Config::Private->get_bool ($path) o $path (string) Gnome2::Config->set_bool ($path, $value) o $path (string) o $value (boolean) Gnome2::Config::Private->set_bool ($path, $value) o $path (string) o $value (boolean) list = Gnome2::Config->get_bool_with_default ($path) o $path (string) Returns a boolean indicating whether the default was used and the actual value. list = Gnome2::Config::Private->get_bool_with_default ($path) o $path (string) Gnome2::Config->clean_file ($path) o $path (string) Gnome2::Config::Private->clean_file ($path) o $path (string) Gnome2::Config->clean_key ($path) o $path (string) Gnome2::Config::Private->clean_key ($path) o $path (string) Gnome2::Config->clean_section ($path) o $path (string) Gnome2::Config::Private->clean_section ($path) o $path (string) Gnome2::Config->drop_all Gnome2::Config->drop_file ($path) o $path (string) Gnome2::Config::Private->drop_file ($path) o $path (string) double = Gnome2::Config->get_float ($path) o $path (string) double = Gnome2::Config::Private->get_float ($path) o $path (string) Gnome2::Config->set_float ($path, $value) o $path (string) o $value (double) Gnome2::Config::Private->set_float ($path, $value) o $path (string) o $value (double) list = Gnome2::Config->get_float_with_default ($path) o $path (string) Returns a boolean indicating whether the default was used and the actual value. list = Gnome2::Config::Private->get_float_with_default ($path) o $path (string) boolean = Gnome2::Config->has_section ($path) o $path (string) boolean = Gnome2::Config::Private->has_section ($path) o $path (string) scalar = Gnome2::Config->init_iterator ($path) o $path (string) scalar = Gnome2::Config::Private->init_iterator ($path) o $path (string) scalar = Gnome2::Config->init_iterator_sections ($path) o $path (string) scalar = Gnome2::Config::Private->init_iterator_sections ($path) o $path (string) integer = Gnome2::Config->get_int ($path) o $path (string) integer = Gnome2::Config::Private->get_int ($path) o $path (string) Gnome2::Config->set_int ($path, $value) o $path (string) o $value (integer) Gnome2::Config::Private->set_int ($path, $value) o $path (string) o $value (integer) list = Gnome2::Config->get_int_with_default ($path) o $path (string) Returns a boolean indicating whether the default was used and the actual value. list = Gnome2::Config::Private->get_int_with_default ($path) o $path (string) Gnome2::Config->pop_prefix Gnome2::Config->push_prefix ($path) o $path (string) string = Gnome2::Config->get_real_path ($path) o $path (string) string = Gnome2::Config::Private->get_real_path ($path) o $path (string) string = Gnome2::Config->get_string ($path) o $path (string) string = Gnome2::Config::Private->get_string ($path) o $path (string) Gnome2::Config->set_string ($path, $value) o $path (string) o $value (string) Gnome2::Config::Private->set_string ($path, $value) o $path (string) o $value (string) list = Gnome2::Config->get_string_with_default ($path) o $path (string) Returns a boolean indicating whether the default was used and the actual value. list = Gnome2::Config::Private->get_string_with_default ($path) o $path (string) boolean = Gnome2::Config->sync boolean = Gnome2::Config->sync_file ($path) o $path (string) boolean = Gnome2::Config::Private->sync_file ($path) o $path (string) string = Gnome2::Config->get_translated_string ($path) o $path (string) string = Gnome2::Config::Private->get_translated_string ($path) o $path (string) Gnome2::Config->set_translated_string ($path, $value) o $path (string) o $value (string) Gnome2::Config::Private->set_translated_string ($path, $value) o $path (string) o $value (string) list = Gnome2::Config->get_translated_string_with_default ($path) o $path (string) list = Gnome2::Config::Private->get_translated_string_with_default ($path) o $path (string) scalar = Gnome2::Config->get_vector ($path) o $path (string) scalar = Gnome2::Config::Private->get_vector ($path) o $path (string) Gnome2::Config->set_vector ($path, $value) o $path (string) o $value (scalar) Gnome2::Config::Private->set_vector ($path, $value) o $path (string) o $value (scalar) list = Gnome2::Config->get_vector_with_default ($path) o $path (string) Returns a boolean indicating whether the default was used and the actual value. list = Gnome2::Config::Private->get_vector_with_default ($path) o $path (string) SEE ALSO
Gnome2 COPYRIGHT
Copyright (C) 2003-2004 by the gtk2-perl team. This software is licensed under the LGPL. See Gnome2 for a full notice. perl v5.14.2 2011-11-16 Gnome2::Config(3pm)
All times are GMT -4. The time now is 03:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy