Sponsored Content
Top Forums Shell Programming and Scripting Replace a line with another string + Solaris Post 303033640 by vgersh99 on Tuesday 9th of April 2019 03:21:28 PM
Old 04-09-2019
something along these lines:
Code:
echo 'uri ldaps://pbs-mast.prd.prp.ia/ ldaps://dbs-mast.prd.prp.ia/' | awk '/^uri ldaps:/{print $2}'

NOTE: use nawk on Solaris.
This User Gave Thanks to vgersh99 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search for a string ,replace the whole line with new line

hai i am very new to unix. i am having two files like this. first.properties cache.ZA.TL_CCY=SELECT trim(CCY_CODE)||trim(COUNTRY_CODE)||trim(CITY_CODE) AS... (4 Replies)
Discussion started by: kkraja
4 Replies

2. Red Hat

How to replace a particular string in a line

I have a file with has the following data abaddda;;;;;;;;asdfd;;;d;dadfewdff;f;v;v;v;;v;v;v;v;v;v;v;w;; ;frf;r;v;afd;f;ad;f;d;;va;;g;g;sd;a;dg;ag;ads;ga;dga;d;dsa;;;; ;;sd;df;asd;f;df;adf;adf;;df;df;;d;f;f;sf;df;f;df;;fd;f;f;sdfd;;;; I want to replace every 13 th semicolon ; in... (1 Reply)
Discussion started by: Raju Datla
1 Replies

3. Shell Programming and Scripting

Replace a string after n semicolon every line

I have a file that is formatted in this way. a1;b2;c33;d4;e5;e;f;f;f;s d;ds;d;a;v;b;g;gr;r;rt;fdf s1;s2;s2;s3;s4; b1;f2;g3;h4;a3c4e;xcsd;fds; sd2;fs4;fs2;sdf3; I want to replace the value just before the 4th semicolon to empty string, regardless the value, such that it looks... (3 Replies)
Discussion started by: alienated
3 Replies

4. Shell Programming and Scripting

replace (sed?) a single line/string in file with multiple lines (string) from another file??

Can someone tell me how I can do this? e.g: Say file1.txt contains: today is monday the 22 of NOVEMBER 2010 and file2.txt contains: the 11th month of How do i replace the word NOVEMBER with (5 Replies)
Discussion started by: tuathan
5 Replies

5. Solaris

Line too long error Replace string with new line line character

I get a file which has all its content in a single row. The file contains xml data containing 3000 records, but all in a single row, making it difficult for Unix to Process the file. I decided to insert a new line character at all occurrences of a particular string in this file (say replacing... (4 Replies)
Discussion started by: ducati
4 Replies

6. Shell Programming and Scripting

Find a line using a condition and replace a string in that line

Hello, I have a 100 line code. I have given a sample of it below: ABC*654654*1*54.54*21.2*87*1*654654654654 CCC*FS*FS*SFD*DSF GGG*FGH*CGB*FBDFG*FGDG ABC*654654*1*57.84*45.4*88*2*6546546545 CCC*WSF*SG*FGH*GHJ ADA*AF*SFG*DFGH*FGH*FGTH I need to select the line starting with "ABC" its... (6 Replies)
Discussion started by: nithins007
6 Replies

7. Emergency UNIX and Linux Support

Find a line using a condition and replace a string in that line

Hello, I have a 100 line code. I have given a sample of it below: ABC*654654*1*54.54*21.2*87*1*654654654654 CCC*FS*FS*SFD*DSF GGG*FGH*CGB*FBDFG*FGDG ABC*654654*1*57.84*45.4*88*2*6546546545 CCC*WSF*SG*FGH*GHJ ADA*AF*SFG*DFGH*FGH*FGTH I need to select the line starting with "ABC" its... (3 Replies)
Discussion started by: nithins007
3 Replies

8. Shell Programming and Scripting

Read line by line and replace string.

Hi, I currently have a problem that I need to read a file line by line. After I read it line by line there are some commands in which I have to change a specific string.(In my case, I have to make a script that changes all the passwords into hash value) Here is a sample input... (3 Replies)
Discussion started by: thebennnn
3 Replies

9. UNIX for Dummies Questions & Answers

Search for a string,delete the line and replace with new string in a file

Hi Everyone, I have a requirement in ksh where i have a set of files in a directory. I need to search each and every file if a particular string is present in the file, delete that line and replace that line with another string expression in the same file. I am very new to unix. Kindly help... (10 Replies)
Discussion started by: Pradhikshan
10 Replies

10. UNIX for Dummies Questions & Answers

Replace string at begining of the line

Hello again people, I have a list of websites in this format: domain.com domain1.com domain2.com domainwww.com domain2www.com domain3www.com www.domain.com www.domain2.com www.domain3.com I want to replace the string "www." with "nothing" but only lines that start with "www." ... (3 Replies)
Discussion started by: galford
3 Replies
Net::LDAPS(3pm) 					User Contributed Perl Documentation					   Net::LDAPS(3pm)

NAME
Net::LDAPS - use LDAP over an SSL connection SYNOPSIS
use Net::LDAPS; $ldaps = Net::LDAPS->new('myhost.example.com', port => '10000', verify => 'require', capath => '/usr/local/cacerts/'); # alternate way use Net::LDAP; $ldaps = Net::LDAP->new('ldaps://myhost.example.com:10000', verify => 'require', capath => '/usr/local/cacerts/'); DESCRIPTION
Communicate using the LDAP protocol to a directory server using an encrypted (SSL) network connection. This mechanism is non-standard but widely supported; consider using LDAPv3 with the standard TLS extension if possible (many servers do not support it yet.) See "start_tls" in Net::LDAP. All the normal "Net::LDAP" methods can be used with a "Net::LDAPS" object; see Net::LDAP for details. CONSTRUCTOR
new ( HOST [, OPTIONS ] ) Create a new connection. HOST is the hostname to contact. OPTIONS is a number of key/value pairs. See "new" in Net::LDAP for details. SEE ALSO
Net::LDAP, IO::Socket::SSL BUGS
You cannot have more than one LDAPS connection at any one time, due to restrictions in the underlying Net::SSLeay code. AUTHOR
Chris Ridd <chris.ridd@isode.com> COPYRIGHT
Copyright (c) 2000-2004, Chris Ridd and Graham Barr. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-01-29 Net::LDAPS(3pm)
All times are GMT -4. The time now is 07:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy