08-20-2008
how to use sed or perl command to find and replace a directory in a file
how to use sed command to find and replace a directory
i have a file.. which contains lot of paths ...
for eg.. file contains..
/usr/kk/rr/12345/1
/usr/kk/rr/12345/2
/usr/kk/rr/12345/3
/usr/kk/rr/12345/4
/usr/kk/rr/12345/5
/usr/kk/rr/12345/6
/usr/kk/rr/12345/7
/usr/kk/rr/12345/8
i want to replace /usr/kk/rr/12345/ with /usr/kk/yy/12555/
pls help
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have korn shell script that genretaets 100 file based on template replacing the number.
The template file is as below:
$ cat template
file number: NUMBER
The shell script is as below:
$ cat gen.sh
#!/bin/ksh
i=1;
while ((i <= 100)); do
sed "s/NUMBER/$i/" template > file_${i}
((... (1 Reply)
Discussion started by: McLan
1 Replies
2. Shell Programming and Scripting
Hi, Im very new to the world of sed so I'm really not even sure if this is possible. What i need to do is read from a flat file and every time i see this line:
VAL=123,456
I need to change 456 to 457 for every occurence of this line in the file. The numbers 123 and 456 are different for... (6 Replies)
Discussion started by: LT_2008
6 Replies
3. Shell Programming and Scripting
Hi folks,
I need help to finish this script please.
see below:
I have an input file with all the IP address to names formated like so in a txt file
addnsr1pri 166.7.3.105
addnsr1sec 166.2.100.22
addnsr2pri 166.2.220.121
addnsr2sec 166.3.68.45... (12 Replies)
Discussion started by: richsark
12 Replies
4. Shell Programming and Scripting
Hello All,
Here is what I am trying to do and maybe you guys can point me in the right direction. I have a file that contains the following string(s):
WARNING: </d1/test/program1> did not find item1
WARNING: </d1/test/program1> item1 does not exist
WARNING: </d1/test/program2> item1 failed... (1 Reply)
Discussion started by: maxshop
1 Replies
5. Shell Programming and Scripting
Hello All,
I need a sed command to find and replace below text in multiple files in a directory.
Original Text :- "$SCRIPT_PATH/files"
Replace with :- "$RESOURCE_FILE"
Thank you in advance !!!
Regards,
Anand Shah (1 Reply)
Discussion started by: anand.shah
1 Replies
6. Shell Programming and Scripting
Hi,
Am trying to replace a character '-' with 'O' in position 289 in my file but am not success with below command.
sed 's/^\(.\{289\}\)-/\1O/' filename
sed: 0602-404 Function s/^\(.\{289\}\)-/\1O/ cannot be parsed.
Thanks in Advance
Sara
Video tutorial on how to use code tags in The... (9 Replies)
Discussion started by: Sara183
9 Replies
7. Shell Programming and Scripting
Hi
I know sed and awk has options to give range of line numbers, but
I need to replace pattern in specific lines
Something like
sed -e '1s,14s,26s/pattern/new pattern/' file name
Can somebody help me in this....
I am fine with see/awk/perl
Thank you in advance (9 Replies)
Discussion started by: dani777
9 Replies
8. Shell Programming and Scripting
Hi Gurus,
I did an exhaustive search for finding the script using "sed" to exclude the first line of file during find and replace.
The first line in my file is the header names.
Thanks for your help.. (4 Replies)
Discussion started by: ks_reddy
4 Replies
9. Shell Programming and Scripting
The content of the file filea.txt is as follows.
---------
case $HOSTNAME in
aaa)
DS_PARM_VALUE_SET=vsDev
APT_Configuration_File=/appl/infoserver/Server/Configurations/2node.apt
;;
bbb)
DS_PARM_VALUE_SET=vsQA... (3 Replies)
Discussion started by: kmanivan82
3 Replies
10. Shell Programming and Scripting
I have a file example.txt as follows :SomeTextGoesHere
$$TODAY_DT=20140818
$$TODAY_DT=20140818
$$TODAY_DT=20140818I need to automatically update the date (20140818) in the above file, by getting the new date as argument, using a shell script.
(It would even be better if I could pass... (5 Replies)
Discussion started by: SriRamKrish
5 Replies
LEARN ABOUT DEBIAN
pinot-search
PINOT-SEARCH(1) User Commands PINOT-SEARCH(1)
NAME
pinot-search - Query search engines from the command-line
SYNOPSIS
pinot-search [OPTIONS] SEARCHENGINETYPE SEARCHENGINENAME|SEARCHENGINEOPTION QUERYINPUT
DESCRIPTION
pinot-search - Query search engines from the command-line
OPTIONS
-d, --datefirst
sort by date then by relevance
-h, --help
display this help and exit
-l, --locationonly
only show the location of each result
-m, --max
maximum number of results (default 10)
-r, --storedquery
query input is the name of a stored query
-s, --stemming
stemming language (in English)
-c, --tocsv
file to export results in CSV format to
-x, --toxml
file to export results in XML format to
-v, --version
output version information and exit
Supported search engine types are : 'opensearch' 'sherlock' 'xapian'
EXAMPLES
pinot-search opensearch /usr/share/pinot/engines/KrustyDescription.xml "clowns"
pinot-search --max 20 sherlock /usr/share/pinot/engines/Bozo.src "clowns"
pinot-search googleapi mygoogleapikey "clowns"
pinot-search xapian ~/.pinot/index "label:Clowns"
pinot-search --stemming english xapian somehostname:12345 "clowning"
REPORTING BUGS
Report bugs to fabrice.colin@gmail.com
This is free software. You may redistribute copies of it under the terms of the GNU General Public License
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>.
There is NO WARRANTY, to the extent permitted by law.
pinot-search - pinot 1.0 June 2012 PINOT-SEARCH(1)