Sponsored Content
Top Forums UNIX for Dummies Questions & Answers search a pattern across all file and replace it to all files. Post 302531858 by Peasant on Saturday 18th of June 2011 08:42:04 AM
Old 06-18-2011
Code:
s - substitute
# - chosen seperator for s (most often is '/' in other examples) 
"user@wherever" - string to be matched
"user@whenever" - string to replace matched string
g - global change
< "$FILE" - take input from $FILE
>/tmp/$$ - output to a file named like pid of running script ($$)

This User Gave Thanks to Peasant For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search for a Pattern and Replace

Hello All, Can you help me with this , I need to search a pattern replace it with the new pattern in all the files in a directory. what would be the easiest way to do that? Thanks in advance. :) Sam, (6 Replies)
Discussion started by: sbasetty
6 Replies

2. Shell Programming and Scripting

SED Search Pattern and Replace with the Pattern

Hello All, I have a string "CP_STATUS OSSRC_R6_0_Shipment_R1H_CU AOM_901046 R1H_LLSV1_2008031", and I just want to extract LLSV1, but I dont get the expected result when using the sed command below. # echo "CP_STATUS OSSRC_R6_0_Shipment_R1H_CU AOM_901046 R1H_LLSV1_2008031" | awk '{print... (4 Replies)
Discussion started by: racbern
4 Replies

3. Shell Programming and Scripting

perl:: search for tow pattern and replace the third pattern

Hi i want to search two pattern on same line and replace onther pattern.. INPut file aaaa bbbbb nnnnnn ttttt cccc bbbbb nnnnnn ppppp dddd ccccc nnnnnn ttttt ffff bbbbb oooooo ttttt now i want replace this matrix like.. i want search for "bbbbb","nnnnnn" and search and replace for... (4 Replies)
Discussion started by: nitindreamz
4 Replies

4. Shell Programming and Scripting

search the pattern in a file and replace with variable already defined previously in csh

I want to replace a certain pattern with the variable already defined. e.g. set path_verilog = /home/priya/bin/verilogfile my file contents are : verilog new verilog is defined here verilog_path_comes I am using the below command sed 's/verilog_path_comes/'$path_verilog'/g' <filename>... (2 Replies)
Discussion started by: nehashine
2 Replies

5. Shell Programming and Scripting

Search & Replace in Multiple Files by reading a input file

Hi, I have a folder which contains multiple config.xml files and one input file, Please see the below format. Config Files format looks like :- Code: <application name="SAMPLE-ARCHIVE"> <NVPairs name="Global Variables"> <NameValuePair> ... (0 Replies)
Discussion started by: haiksuresh
0 Replies

6. Shell Programming and Scripting

Help needed :Search and Replace a string pattern with empty in an xml file in unix

Search and Replace a string pattern with empty in an xml file in unix: My xml file would be like this : <Accounts><Name>Harish</Name><mobile>90844444444444445999 </mobile><TRIG>srcujim-1</TRIG></Accounts><Accounts><Name>Satish</Name><mobile>908999</mobile><TRIG>ettertrtt-1</TRIG></Accounts> ... (1 Reply)
Discussion started by: harish_s_ampeo
1 Replies

7. Shell Programming and Scripting

Mutli line pattern search & replace in a xml file

Hello guys, I need your help for a specific sed command that would search for a multi line pattern and if found, would replace it by another multi line pattern. For instance, here is the input: <RefNickName>abcd</RefNickName> <NickName>efgh</NickName> <Customize> ... (0 Replies)
Discussion started by: xciteddd
0 Replies

8. Shell Programming and Scripting

Search & Replace in Multiple Files by reading a input file

I have a environment property file which contains: Input file: value1 = url1 value2 = url2 value3 = url3 and so on. I need to search all *.xml files under directory for value1 and replace it with url1. Same thing I have to do for all values mentioned in input file. I need script in unix bash... (7 Replies)
Discussion started by: Shamkamde
7 Replies

9. Post Here to Contact Site Administrators and Moderators

Search for a pattern and replace a space at specific position with a Character in File

In file, we have millions of records each of 1000 in length. And at specific position say 800 there is a space, we need to replace it with Character X if the ID in that row starts with 123. So far i have used the below which is replacing space at that position to X but its not checking for... (3 Replies)
Discussion started by: Jagmeet Singh
3 Replies
ERR_print_errors(3SSL)						      OpenSSL						    ERR_print_errors(3SSL)

NAME
ERR_print_errors, ERR_print_errors_fp - print error messages SYNOPSIS
#include <openssl/err.h> void ERR_print_errors(BIO *bp); void ERR_print_errors_fp(FILE *fp); DESCRIPTION
ERR_print_errors() is a convenience function that prints the error strings for all errors that OpenSSL has recorded to bp, thus emptying the error queue. ERR_print_errors_fp() is the same, except that the output goes to a FILE. The error strings will have the following format: [pid]:error:[error code]:[library name]:[function name]:[reason string]:[file name]:[line]:[optional text message] error code is an 8 digit hexadecimal number. library name, function name and reason string are ASCII text, as is optional text message if one was set for the respective error code. If there is no text string registered for the given error code, the error string will contain the numeric code. RETURN VALUES
ERR_print_errors() and ERR_print_errors_fp() return no values. SEE ALSO
err(3), ERR_error_string(3), ERR_get_error(3), ERR_load_crypto_strings(3), SSL_load_error_strings(3) HISTORY
ERR_print_errors() and ERR_print_errors_fp() are available in all versions of SSLeay and OpenSSL. 1.0.1e 2013-02-11 ERR_print_errors(3SSL)
All times are GMT -4. The time now is 05:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy