Sponsored Content
Top Forums Shell Programming and Scripting how to change the content thru sed..... Post 302136719 by manas_ranjan on Wednesday 19th of September 2007 08:54:44 AM
Old 09-19-2007
how to change the content thru sed.....

Hi Everybody,

Another headache form myside,

i have a file name noname.txt having content as
CS007=NEW

and i have to write a scipt which will take the parameters as update,delete... with the 1st field of noname.txt (i.e. here CS007)
whose objective is to change the 2nd field of noname.txt as update or delete as per the input.

how can i achieve this for the following line.......
sed ' /CS007/ c\CS007=UPDATE' noname.txt using the variables...

like

sed ' /$1/ c\$1=$2' noname.txt

any other suggestions are also welcome....

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mass Change content in all files

Hi, Are there any sample scripts to change content like file paths, profile paths etc., from test version to production , instead of changing one by one, i would like to pass the in file (prod version/Test version) to convert to test or prod verions. any help is appreciated!! ~R (1 Reply)
Discussion started by: terala
1 Replies

2. Shell Programming and Scripting

change field content awk

I have a line like this: I want to move HTTP/1.1 200 OK to the next line and put a blank line between the two lines i.e. How can i get it using awk? Thanks in advance (2 Replies)
Discussion started by: littleboyblu
2 Replies

3. UNIX for Advanced & Expert Users

Need help to change the content for remote located file

Hi All, I have one file that sits on 4 diffrent servers, those servers are diffrent region based and they are authentication protected and that file has a diff port numbers, so when run the script it must ask my login details,region of server and port no for that file once it took from me... (1 Reply)
Discussion started by: tmarjuna
1 Replies

4. Shell Programming and Scripting

How to change a file's content by row?

Greetings. So the question is basically the same as it's in the title. I'd like to write a program that changes a file by rows. So to clarify it. (i know i shouldn't use code,/code here but i would like to separate it) So for example a text file looks like something like this: Happy... (5 Replies)
Discussion started by: buddhist
5 Replies

5. UNIX for Advanced & Expert Users

To change the colour of the content in email sent through unix

Hi I want to change the color of the email content sent through unix. I tried a lot and left in vain. I heard that it could be done by sending the email as HTML. But I don't how to do it. Can you all share your ideas? ~sakthifire (1 Reply)
Discussion started by: sakthifire
1 Replies

6. Shell Programming and Scripting

sed, awk [TAG]$content[/TAG] How to get var in $content in textfile?

Hello, I got a Qstion. Im posting to a phpbb forum with bash and curl.. i have a text file with the following tags that i post to the forum: $var1 $var2 $var3 How can i with sed or awk put var content from shell script between the ... in the... (7 Replies)
Discussion started by: atmosroll
7 Replies

7. Linux

when SCP, does file content change?

Good day to you all, Just want to check here, i know when scping a file, size might change due to space issue. it might sound silly, but does file content get change too? if so, what kind of situation that might be? (1 Reply)
Discussion started by: ahtat99
1 Replies

8. Shell Programming and Scripting

Change the content of files but not change the date

I have 100 files in a directory , all the files have a word "error" and they are created in different date . Now I would like to change the word from "error" to "warning" , and keep the date of the files ( that means do not change the file creation date after change the word ) , can advise what can... (0 Replies)
Discussion started by: ust3
0 Replies

9. Shell Programming and Scripting

Change the content of files but not change the date

I have 100 files in a directory , all the files have a word "error" and they are created in different date . Now I would like to change the word from "error" to "warning" , and keep the date of the files ( that means do not change the file creation date after change the word ) , can advise what can... (7 Replies)
Discussion started by: ust3
7 Replies

10. Shell Programming and Scripting

Script to change the file content using some conditions

Hello, I would like to change the content of the file that has few blocks starts with 10 and ends with ";" File1.txt 10 bonuses D 20 MATCHED 30 UPD COL 40 (SOL=30) 20 NOT MATCHED 30 INS COL 40 (SOL=30) ; 10 bonuses D 20 MATCHED 30 UPD COL 40... (5 Replies)
Discussion started by: Mannu2525
5 Replies
HTTP::Message(3)					User Contributed Perl Documentation					  HTTP::Message(3)

NAME
HTTP::Message - Class encapsulating HTTP messages SYNOPSIS
package HTTP::Request; # or HTTP::Response require HTTP::Message; @ISA=qw(HTTP::Message); DESCRIPTION
An "HTTP::Message" object contains some headers and a content (body). The class is abstract, i.e. it only used as a base class for "HTTP::Request" and "HTTP::Response" and should never instantiated as itself. The following methods are available: $mess = HTTP::Message->new This is the object constructor. It should only be called internally by this library. External code should construct "HTTP::Request" or "HTTP::Response" objects. $mess->clone() Returns a copy of the object. $mess->protocol([$proto]) Sets the HTTP protocol used for the message. The protocol() is a string like "HTTP/1.0" or "HTTP/1.1". $mess->content([$content]) The content() method sets the content if an argument is given. If no argument is given the content is not touched. In either case the previous content is returned. $mess->add_content($data) The add_content() methods appends more data to the end of the current content buffer. $mess->content_ref The content_ref() method will return a reference to content buffer string. It can be more efficient to access the content this way if the content is huge, and it can even be used for direct manipulation of the content, for instance: ${$res->content_ref} =~ s/foo/bar/g; $mess->headers; Return the embedded HTTP::Headers object. $mess->headers_as_string([$endl]) Call the as_string() method for the headers in the message. This will be the same as: $mess->headers->as_string but it will make your program a whole character shorter :-) All unknown "HTTP::Message" methods are delegated to the "HTTP::Headers" object that is part of every message. This allows convenient access to these methods. Refer to HTTP::Headers for details of these methods: $mess->header($field => $val); $mess->push_header($field => $val); $mess->init_header($field => $val); $mess->remove_header($field); $mess->scan(&doit); $mess->date; $mess->expires; $mess->if_modified_since; $mess->if_unmodified_since; $mess->last_modified; $mess->content_type; $mess->content_encoding; $mess->content_length; $mess->content_language $mess->title; $mess->user_agent; $mess->server; $mess->from; $mess->referer; $mess->www_authenticate; $mess->authorization; $mess->proxy_authorization; $mess->authorization_basic; $mess->proxy_authorization_basic; COPYRIGHT
Copyright 1995-2001 Gisle Aas. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. libwww-perl-5.65 2001-11-15 HTTP::Message(3)
All times are GMT -4. The time now is 10:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy