Sponsored Content
Top Forums Shell Programming and Scripting Adding a String after a text in a Line (using nawk) Post 302774259 by RudiC on Friday 1st of March 2013 01:15:19 PM
Old 03-01-2013
Code:
$ sed 's:\(-name FILTER\):\1 -username filter:' file
-name FILTER -username filter -node 60265 . . .

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding Text To each line of a file

How would I add text to the beginning of each line in a text file in a script right after the file is created from another text file. (4 Replies)
Discussion started by: cubs0729
4 Replies

2. Shell Programming and Scripting

adding text to end of each line in a file

I'm needing to add a "hour:min" to the end of each line in a document. The document in this case is only going to be one line. if this inserts it at the end, what needs to be changed to add something at the end... /bin/echo "%s/^/$filler/g\nwq!" | ex -s $oFile Thank you... (2 Replies)
Discussion started by: cubs0729
2 Replies

3. Shell Programming and Scripting

Adding specific text and spaces to each line in a text file

Hi, I wanted to add specific text to each row in a text file containing three rows. Example: 0 8 7 6 5 5 7 8 9 0 7 9 7 8 9 0 1 2 And I want to add a 21 at the beginning of the first row, and blank spaces at the beginning of the second two rows. To get this: 21 0 8 7 6 5 5 7 8... (4 Replies)
Discussion started by: hertingm
4 Replies

4. UNIX for Dummies Questions & Answers

Adding one string at the beginning of each line in a file

Hi, I have file a.txt as below. I want to add one string root beginning of each line. Sample file a.txt aaa bbb ccc Sample output Root aaa Root bbb Root ccc Can any one help me on this? (6 Replies)
Discussion started by: siba.s.nayak
6 Replies

5. Shell Programming and Scripting

Adding text in final line

Dear Friends, I have a flat file where last line of it has word D$mhtt I want to add a space and back slash after it. Also wanna add -S "J" in the last line. Following example will make it clear. I have this in the last line of file D$mhtt I want D$mhtt \ -S "J" Please... (5 Replies)
Discussion started by: anushree.a
5 Replies

6. Shell Programming and Scripting

adding a line to a text file

I have a tab delimited text file, id name distance 1 3325167 0.334561754018 2 3290488 0.389444269458 3 3288794 0.392312701782 4 3347602 0.392532202097 5 3295355 0.394394169485 I need to add a line after the header line. The first and third field of... (3 Replies)
Discussion started by: LMHmedchem
3 Replies

7. Shell Programming and Scripting

[string processing]Adding new line in file

I have a report file which somewhere has a lines starting with word ".sub" I have a new variable named $new. What i am trying to do is insert the content of $new just before the occurrence of ".sub" in the report file. How can I do that? (11 Replies)
Discussion started by: animesharma
11 Replies

8. UNIX for Dummies Questions & Answers

[Help] Adding text to a variable line in a file

Hey guys, I need to write a script that will add a specific text at the end of a specific line (of a text file). but the line is a variable this is my text file : device_2 ansible_ssh_host=127.0.0.1 ansible_ssh_port=30000 ansible_ssh_user='root' device_2 ansible_ssh_host=127.0.0.1... (1 Reply)
Discussion started by: OdedOvdat
1 Replies

9. Shell Programming and Scripting

Adding a text in the beginning of a line

Hi, I am doing something like below: cat file1>file3and cat file2>>file3 I wanted to check if there is a way to write a custom message(hardcoded message)something like below at the beginning of each line then PIPE delimitiation and then followed by remaining record. cat file1... (7 Replies)
Discussion started by: Saanvi1
7 Replies

10. Shell Programming and Scripting

Adding text to the first line of a shell script

the first line of every unix script written in an interpreted language always has a "#!<path-to-the-language>" is there a way to include other text in that first line without it affecting the ability of the script to run??? for instance, if i change the following line: #!/bin/sh echo blah... (1 Reply)
Discussion started by: SkySmart
1 Replies
Net::LDAP::Filter(3)					User Contributed Perl Documentation				      Net::LDAP::Filter(3)

NAME
Net::LDAP::Filter - representation of LDAP filters SYNOPSIS
use Net::LDAP::Filter; $filter = Net::LDAP::Filter->new( $filter_str ); DESCRIPTION
The Net::LDAP::Filter object lets you directly manipulate LDAP filters without worrying about the string representation and all the associated escaping mechanisms. CONSTRUCTOR
new ( [ FILTER ] ) Create a new object. If FILTER is given, parse it. METHODS
parse ( FILTER ) Parse FILTER, updating the object to represent it. as_string Return the filter in text form. print ( [ FH ] ) Print the text representation of the filter to FH, or the currently selected output handle if FH is not given. negate ( ) Logically negate/invert the filter object so that it matches the opposite set of entries as the original. Instead of simply negating the text form by surrounding it with the not operator, the negation is done by recursively applying De Morgan's law. Here is an example: (|(&(cn=A)(cn=B))(|(!(cn=C))(cn=D))) gets negated to (&(|(!(cn=A))(!(cn=B)))(&(cn=C)(!(cn=D)))) FILTER SYNTAX
Below is the syntax for a filter given in RFC 4515 http://www.ietf.org/rfc/rfc4515.txt filter = "(" filtercomp ")" filtercomp = and / or / not / item and = "&" filterlist or = "|" filterlist not = "!" filter filterlist = 1*filter item = simple / present / substring / extensible simple = attr filtertype value filtertype = equal / approx / greater / less equal = "=" approx = "~=" greater = ">=" less = "<=" extensible = attr [":dn"] [":" matchingrule] ":=" value / [":dn"] ":" matchingrule ":=" value present = attr "=*" substring = attr "=" [initial] any [final] initial = value any = "*" *(value "*") final = value attr = AttributeDescription from Section 4.1.4 of RFC 4511 matchingrule = MatchingRuleId from Section 4.1.8 of RFC 4511 value = AttributeValue from Section 4.1.5 of RFC 4511 Special Character encodings --------------------------- * 2a, * ( 28, ( ) 29, ) 5c, \ NUL 0 SEE ALSO
Net::LDAP, Other online documentation ACKNOWLEDGEMENTS
This document is based on a document originally written by Russell Fulton <r.fulton@auckland.ac.nz>. AUTHOR
Graham Barr <gbarr@pobox.com> Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org>. COPYRIGHT
Copyright (c) 1997-2004 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2013-12-23 Net::LDAP::Filter(3)
All times are GMT -4. The time now is 12:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy