Sponsored Content
Top Forums UNIX for Advanced & Expert Users command to replace the entire line from the key point Post 302350479 by wwwzviadi on Friday 4th of September 2009 02:53:59 AM
Old 09-04-2009
sed -e 's/oldwordname/newwordname/g' filename >newfile
This Command is useful it should work
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Using the Esc key to complete command line typing

Dear Techs, In the past on a different box (HP) I use to be able to complete something I was typing by entering a portion of the filename in the pwd and I would hit the Esc key and it would match the rest of the filename. I did this without understanding how it was setup. Now I am on a new... (1 Reply)
Discussion started by: jxh461
1 Replies

2. Shell Programming and Scripting

Capture entire line in ps command

I need to determine what processes are running at certain times of the day. I have a script that issues the /usr/ucb/ps aux command and captures it to a file. I want to see the cpu usage and memory usage. This command lops off the end of the of the display line so I can't see the entire... (2 Replies)
Discussion started by: MizzGail
2 Replies

3. Shell Programming and Scripting

Perl Search and replace entire line

I have a perl function in my script that needs to replace an entire line in a file sub changestate { my $base = (); my @base = (); open(BASE, $file) || die("Could not open file!"); @base=<BASE>; close (BASE); foreach $base(@base) { if($base =~... (1 Reply)
Discussion started by: insania
1 Replies

4. Shell Programming and Scripting

Replace Entire line if any part matches regexp

Hey guys, I have a file that I've slowly been awking, seding, and greping for data entry. I am down to pull the addresses out to insert them into an excel file. Each address is a few lines, but i want to put a semicolon delimiter in between each address so I can export the text file into excel and... (6 Replies)
Discussion started by: Cocoabean
6 Replies

5. Shell Programming and Scripting

Replace entire line

I want to replace one line from my configuration file with the new settings. The file Name: /etc/httpd/conf/httpd.conf The following line should be replaced with the line mentioned below. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "\"%h\"... (3 Replies)
Discussion started by: shantanuo
3 Replies

6. Shell Programming and Scripting

New process, forgot the key point

i am using a newprocess, but i forgot the key point Changed subject. See post below from Neo (2 Replies)
Discussion started by: Maryeveryday
2 Replies

7. Shell Programming and Scripting

up down arrow key and edit on command line.

I am using ksh, By doing change in .profile as set -o vi my updown and history does not work. Also I can not edit command line on prompt using vi command. My TERM is vt100. What is wrong here ? Thanks. :cool: (3 Replies)
Discussion started by: ekb
3 Replies

8. Shell Programming and Scripting

Specify an entire UNIX command as a command line argument

I'm trying to write a bash script called YN that looks like the following YN "Specify a question" "doThis" "doThat" where "doThis" will be executed if the answer is "y", otherwise "doThat". For example YN "Do you want to list the file dog?" "ls -al dog" "" Here's my attempt... (3 Replies)
Discussion started by: LeoKSimon
3 Replies

9. Shell Programming and Scripting

sed command to replace a line at a specific line number with some other line

my requirement is, consider a file output cat output blah sdjfhjkd jsdfhjksdh sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf hellow there this doesnt look good et cetc etc etcetera i want to replace a line of line number 4 ("this doesnt look good") with some other line ... (3 Replies)
Discussion started by: vivek d r
3 Replies

10. Shell Programming and Scripting

Help with sed to replace entire line

Hi, I need to replace an entire mailx line as follows using sed: sed -e 's/<line1>/<newline>/g' <filename> But I am getting comman garbled error since the new line has many special characters. I enclosed allspecial chars in \ but still no use. Can any one help me? Please use code... (2 Replies)
Discussion started by: vinodhin4
2 Replies
aha(1)								 Ansi HTML Adapter							    aha(1)

NAME
aha - Ansi HTML Adapter SYNOPSIS
aha [options] [-f datei] DESCRIPTION
aha takes SGR-colored Input and prints W3C conform HTML-Code. aha reads the Input from a file or stdin and writes HTML-Code to stdout. OPTIONS
--help , -h , -? A help like this --black , -b Black Background and white "standard color" --pink , -p Pink Background --iso X , -i X Uses ISO 8859-X instead of utf-8. X must be 1..16 --title X , -t X Gives the html output the title --line-fix , -l Uses a fix for inputs using control sequences to change the cursor position like htop. It's a hot fix, it may not work with any pro- gram like htop. (See EXAMPLE) EXAMPLE
aha --help | aha --black --title "the awesome aha help"> aha-help.htm Creates an HTML file with the help of aha with black background colordiff oldfile.c newfile.c | aha > colordiff.htm Creates an HTML file with a colorful diff-output of two files "oldfile.c" and "newfile.c" with white background ls --color=always | aha --pink > ls.htm Creates an HTML file with a colorful ls-output with pink background. echo a | htop | aha --black --line-fix > htop.htm Creates an HTML file with the output of htop. You have to use --line-fix due the other new-line-commands htop uses. AUTHOR
Copyleft Alexander Matthes aka Ziz 2011 zizsdl@googlemail.com SEE ALSO
http://ziz.delphigl.com/tool_aha.php August 31, 2011 aha(1)
All times are GMT -4. The time now is 06:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy