Sponsored Content
Full Discussion: Substitute Command in vi
Top Forums UNIX for Dummies Questions & Answers Substitute Command in vi Post 67736 by vgersh99 on Saturday 26th of March 2005 03:56:17 PM
Old 03-26-2005
Quote:
Originally Posted by Kelam_Magnus
Or
OR From outside the file...

# cat file.in | sed 's/John/Mark/g' > file.out
UUOC

sed 's/John/Mark/g' file.in > file.out
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Substitute in vi

I know in vi you can do :%s/replaceme/withthis/ but if i want to find all lines say without a # at the begining and I want to put it in how would that command be formatted? I can't figure it out for the life of me. #comment blah1 hey1 grrr1 #comment #blah1 #hey1 #grrr1 (5 Replies)
Discussion started by: kingdbag
5 Replies

2. UNIX for Dummies Questions & Answers

how to write perl substitute command in shell scripts

How to write perl substitute command in shell script without invoking a perl script file seperately. for ex: shell script to relace IT with CSC in a file using perl substitute command. (3 Replies)
Discussion started by: param_it
3 Replies

3. Shell Programming and Scripting

How to substitute?

Hi, I have query terms like this: a) apple bannana b) apple bannana AND chickko c) "milk shake" OR Graphes orange whereever there is space substitue with AND operator. I tried like this: (2 Replies)
Discussion started by: vanitham
2 Replies

4. Shell Programming and Scripting

vi substitute

My question is how would I substitute for ceratain number of occurences in a line? If this is my input rjohns BFSTDBS01 Standard Silver NPRO30DINCR 2 Client Is it possible to change the first 3 occurences of space " " to a comma? (7 Replies)
Discussion started by: reggiej
7 Replies

5. Shell Programming and Scripting

howto substitute word in vi command mode

Hi I'm trying to substitute word "January" with word "March" in my script but in certain lines only. I have couple words containing pattern that I want to substitute e.g. - log.January.1.array - log_January_1_array_1 - log.January.1.array - log_January_1_array_11 Trying to do cmd below... (9 Replies)
Discussion started by: presul
9 Replies

6. Shell Programming and Scripting

substitute the starting dollar sign in command with blank

Hi,, Let example cmd: $$config/all Here I want to replace or subsitute blank space and also with any other character in place of "$" sign...and also want to replace backslash (/) with forward (\)......in expect script please could any one help on this.....thank you (2 Replies)
Discussion started by: swethakast
2 Replies

7. UNIX for Dummies Questions & Answers

Substitute in VI

Hi there, i am updating a file on UNIX and have many lines as per below : listen:x:37:4:Network Admin:/usr/net/nls: i would like to substitute from the :/usr to the end of the line. so at the moment im using this : :s/"\/$/ /g but i get an error.can anyone help? thank you (3 Replies)
Discussion started by: brian112
3 Replies

8. Shell Programming and Scripting

sed substitute command -- need help

I am trying to do what I thought should be a simple substitution, but I can't get it to work. File: Desire output: I thought I'd start with a sed command to remove the part of the header line preceding the string "comp", then go on to remove the suffix of the target string (e.g. ":3-509(-)"),... (3 Replies)
Discussion started by: pathunkathunk
3 Replies

9. Shell Programming and Scripting

sed command to substitute contents from external file

Hi All, I am trying to substitute a line in my existing file with the set of lines from another file. Regarding the existing file, i am sure that the line i am substituting will occur only at one place. I have stored the text to be replaced in another file. I am using below command. cat... (7 Replies)
Discussion started by: chpsam
7 Replies

10. Shell Programming and Scripting

Substitute grep command at run time

HI I am trying to use the following code in the shell script (using grep) usage() { echo "Usage: ./$0 <file name> <interval> <pattern>" } METRICS_FILE=$1 INTERVAL=$2 PATTERN="$3" .. if then PATTERN="grep Gx" fi COUNT=`cat ${METRICS_FILE} | "${PATTERN}" |egrep... (8 Replies)
Discussion started by: asifansari
8 Replies
ldapfilter.conf(4)						   File Formats 						ldapfilter.conf(4)

NAME
ldapfilter.conf - configuration file for LDAP filtering routines SYNOPSIS
/etc/opt/SUNWconn/ldap/current/ldapfilter.conf DESCRIPTION
The ldapfilter.conf file contains information used by the LDAP filtering routines. Blank lines and lines that begin with a hash character (#) are treated as comments and ignored. The configuration information consists of lines that contain one to five tokens. Tokens are separated by white space, and double quotes can be used to include white space inside a token. The file consists of a sequence of one or more filter sets. A filter set begins with a line containing a single token called a tag. The filter set consists of a sequence of one or more filter lists. The first line in a filter list must contain four or five tokens: the value pattern, the delimiter list, a filtertemplate, a match description, and an optional search scope. The value pattern is a regular expression that is matched against the value passed to the LDAP library call to select the filter list. The delimiter list is a list of the characters (in the form of a single string) that can be used to break the value into distinct words. The filter template is used to construct an LDAP filter (see description below) The match description is returned to the caller along with a filter as a piece of text that can be used to describe the sort of LDAP search that took place. It should correctly compete both of the following phrases: "One match description match was found for ..." and "Three match description matches were found for...." The search scope is optional, and should be one of base, onelevel, or subtree. If search scope is not provided, the default is subtree. The remaining lines of the filter list should contain two or three tokens, a filter template, a match description and an optional search scope. The filter template is similar in concept to a printf(3C) style format string. Everything is taken literally except for the character sequences: %v Substitute the entire value string in place of the %v. %v$ Substitute the last word in this field. %vN Substitute word N in this field (where N is a single digit 1-9). Words are numbered from left to right within the value starting at 1. %vM-N Substitute the indicated sequence of words where M and N are both single digits 1-9. %vN- Substitute word N through the last word in value where N is again a single digit 1-9. EXAMPLES
Example 1 An LDAP Filter Configuration File The following LDAP filter configuration file contains two filter sets, example1 and example2 onelevel, each of which contains four filter lists. # ldap filter file # example1 "=" " " "%v" "arbitrary filter" "[0-9][0-9-]*" " " "(telephoneNumber=*%v)" "phone number" "@" " " "(mail=%v)" "email address" "^.[. _].*" ". _" "(cn=%v1* %v2-)" "first initial" ".*[. _].$" ". _" "(cn=%v1-*)" "last initial" "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-))" "exact" "(|(sn~=%v1-)(cn~=%v1-))" "approximate" ".*" ". " "(|(cn=%v1)(sn=%v1)(uid=%v1))" "exact" "(|(cn~=%v1)(sn~=%v1))" "approximate" "example2 onelevel" "^..$" " " "(|(o=%v)(c=%v)(l=%v)(co=%v))" "exact" "onelevel" "(|(o~=%v)(c~=%v)(l~=%v)(co~=%v))" "approximate" "onelevel" " " " " "(|(o=%v)(l=%v)(co=%v)" "exact" "onelevel" "(|(o~=%v)(l~=%v)(co~=%v)" "approximate" "onelevel" "." " " "(associatedDomain=%v)" "exact" "onelevel" ".*" " " "(|(o=%v)(l=%v)(co=%v)" "exact" "onelevel" "(|(o~=%v)(l~=%v)(co~=%v)" "approximate" "onelevel" ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ |ATTRIBUTE TYPE |ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWlldap | |Stability Level |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
ldap_getfilter(3LDAP), ldap_ufn(3LDAP), attributes(5) SunOS 5.11 9 Jul 2003 ldapfilter.conf(4)
All times are GMT -4. The time now is 03:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy