Sponsored Content
Top Forums Shell Programming and Scripting Want to use sed to add some parameters at the end of the line Post 302364718 by cfajohnson on Friday 23rd of October 2009 05:23:07 PM
Old 10-23-2009
Quote:
Originally Posted by asirohi
Oops, that was a dumb question, that worked but xml file now just has:-

<execute description="reboot" Results="true" value="high">
<execute description="Stop Servlet" Results="true" value="high">

where as it should be:-

<?xml version="1.0" encoding="UTF-8"?>
<start>
<execute description="reboot" Results="true" value="high">
<execute description="Stop Servlet" Results="true" value="high">
</start>

Why should it be? You used grep, which will only print the matching lines.

Code:
sed '/^<execute/ s/>/ Results="true" value="high">/' "$1" > newfile

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed to end of line

I know this is going to be an easy anwer, but I haven't been able to figure this out - even with the help of the previous posts. I want to go from this PROD USER anon; to this TEST; I have coded a few sed commands, and none of them are getting the job done. anon will not always be the... (2 Replies)
Discussion started by: djschmitt
2 Replies

2. Shell Programming and Scripting

delete to end of line with SED

I have a file with a bunch of similar lines in which I want to extract a phrase delimited by the first occurance of a '>' at the beginning and the first occurance of a '<' at the end (you might have guessed these are beginning/end of HTML tags). Using Sed I have managed to delete up to and... (7 Replies)
Discussion started by: coldcanuck
7 Replies

3. Shell Programming and Scripting

Add white space to the end of a line with sed

Im trying to add 5 blank spaces to the end of each line in a file in a sed script. I can figure out who o put the spaces pretty much anywhere else but at the end. thanks Karl (7 Replies)
Discussion started by: karlanderson
7 Replies

4. Shell Programming and Scripting

sed issue with end of line

Example, Trying to replace text to the end of a line. Text file looks like this PP= 4 PP= 412 PP= 425 I want to replace only the following line: PP= 4 with PP= 2 How can this be done with sed? (3 Replies)
Discussion started by: hanson397
3 Replies

5. Shell Programming and Scripting

Get the 1st 99 characters and add new line feed at the end of the line

I have a file with varying record length in it. I need to reformat this file so that each line will have a length of 100 characters (99 characters + the line feed). AU * A01 EXPENSE 6990370000 CWF SUBC TRAVEL & MISC MY * A02 RESALE 6990788000 Y... (3 Replies)
Discussion started by: udelalv
3 Replies

6. Shell Programming and Scripting

Add new parameters into a line, and redirect the line to other file

How can i add new parameters into a line, and redirect the line to other file? For example: 1.sh name:owner google:richard youtube:student I want a, for example 2.sh with: name:owner:description google:richard:search site youtube:student:video site In the 2.sh, I added a new column:... (7 Replies)
Discussion started by: rafazz
7 Replies

7. UNIX for Dummies Questions & Answers

Removing end of line using SED

Hello Friends, How can I remove the last two values of this line using sed John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638:9/3/90:45900 The result should look like this: John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638 (3 Replies)
Discussion started by: humkhn
3 Replies

8. Shell Programming and Scripting

sed removing until end of line

All: Can somebody help me out with a sed command, which removes the the first occurance of ')' until the end of the line If I have the following input ... (5 Replies)
Discussion started by: BeefStu
5 Replies

9. UNIX for Dummies Questions & Answers

sed - Add a variable line to the end of a block beginning with a regex

Hi, Need some help with sed. I have a file that has sections : e.g. a=blah b=blah d=blah e=blah There's many sections in the file. (1 Reply)
Discussion started by: andyatit
1 Replies

10. Shell Programming and Scripting

How to add a line to the end of a set of files without using sed command?

I understand that the SED command reads all the lines in the file before adding a required line to the end of the file. Is there another command that adds a line to the end of files without reading the entire file.... SED is increasing the processing time as the number of lines in each of the... (1 Reply)
Discussion started by: Kanch
1 Replies
EVP_PKEY_print_private(3SSL)					      OpenSSL					      EVP_PKEY_print_private(3SSL)

NAME
EVP_PKEY_print_public, EVP_PKEY_print_private, EVP_PKEY_print_params - public key algorithm printing routines. SYNOPSIS
#include <openssl/evp.h> int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx); int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx); int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx); DESCRIPTION
The functions EVP_PKEY_print_public(), EVP_PKEY_print_private() and EVP_PKEY_print_params() print out the public, private or parameter components of key pkey respectively. The key is sent to BIO out in human readable form. The parameter indent indicated how far the printout should be indented. The pctx parameter allows the print output to be finely tuned by using ASN1 printing options. If pctx is set to NULL then default values will be used. NOTES
Currently no public key algorithms include any options in the pctx parameter parameter. If the key does not include all the components indicated by the function then only those contained in the key will be printed. For example passing a public key to EVP_PKEY_print_private() will only print the public components. RETURN VALUES
These functions all return 1 for success and 0 or a negative value for failure. In particular a return value of -2 indicates the operation is not supported by the public key algorithm. SEE ALSO
EVP_PKEY_CTX_new(3), EVP_PKEY_keygen(3) HISTORY
These functions were first added to OpenSSL 1.0.0. 1.0.1e 2013-02-11 EVP_PKEY_print_private(3SSL)
All times are GMT -4. The time now is 07:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy