Sponsored Content
Top Forums Shell Programming and Scripting replacing specific lines in a file Post 302091138 by hcclnoodles on Friday 29th of September 2006 09:46:41 AM
Old 09-29-2006
thats great but if i run that command from the command line it outputs the correct result to the screen but doesnt actually edit the file


How do i get it to make a permanent change to the file ??
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

replacing first line or lines in a file

hey guys, how do i replace only a line within a file without messing up the rest of the contents of the file? see, if possible can you guys give me a straight forward way to do this. i dont want a complex command. what i mean is i know i can accomplish this by using sed, well, i think i can,... (3 Replies)
Discussion started by: Terrible
3 Replies

2. UNIX for Dummies Questions & Answers

how to display specific lines of a specific file

are there any basic commands that can display lines 99 - 101 of the /etc/passwd file? I'm thinking use of head and tail, but I forget what numbers to use and where to put /etc/passwd in the command. (2 Replies)
Discussion started by: raidkridley
2 Replies

3. Shell Programming and Scripting

Replacing Block of lines in a text file

Dear All, Regards of the Day. I have a text file with some functions: Function1 { parameter 1 parameter 2 parameter 3 } end Function2 { parameter 1 parameter 2 parameter 3 } (1 Reply)
Discussion started by: ashisharora
1 Replies

4. Shell Programming and Scripting

replacing field in specific line in a file

Hi, I know there are lots of threads on replacing text within files, usually using sed or awk. However, I find it hard to adapt examples that I found to my specific case. I am kind of new to UNIX and have hard times learning the syntax either for sed or awk so I would appreciate any help. Here's... (5 Replies)
Discussion started by: vytenis
5 Replies

5. UNIX for Dummies Questions & Answers

Replacing all cells that have a specific value in a text file

I have a space delimited text file where I want to replace all cells that are 0 with NA. However I cannot simply use 'sed/0/NA/g' because there are other 0's in the text file that are part of numbers. Example input: 896.933464285715 0 874.691732142857 866.404660714286 Output:... (1 Reply)
Discussion started by: evelibertine
1 Replies

6. Shell Programming and Scripting

Replacing specific lines with another lines

Hi, I have a file with many lines, then i have following list of lines(line number 5,12,19,5,and 28) i need to replace these lines of a file with another lines as shown below these text contains special charecter like= (/:;){} Line_number Text to replace with 5 abc... (1 Reply)
Discussion started by: MILAN KUMAR
1 Replies

7. Shell Programming and Scripting

Summing over specific lines and replacing the lines with the sum using sed, awk

Hi friends, This is sed & awk type question. I have a text file which has numbers spread all over the file. I want to sum the series of numbers whenever i find it and produce an output file with the sum. For example ###start of input text file #### abc def ghi 1 2 3 4 kjld random... (3 Replies)
Discussion started by: kaaliakahn
3 Replies

8. Shell Programming and Scripting

Summing over specific lines and replacing the lines with the sum

Hi friends, This is sed & awk type question. It is slightly different from my previous question. I have a text file which has numbers spread all over the file. I want to sum the series of numbers (but no more than 10 numbers in series) whenever i find it and produce an output file with the... (4 Replies)
Discussion started by: kaaliakahn
4 Replies

9. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies

10. Shell Programming and Scripting

Matching and Replacing file lines starting with $

Here is the task that I was presented with: I am dealing with about a 10,000 line input deck file for an analysis. About 10 separate blocks of around 25 lines of code each need to be updated in the input deck. The input deck (deckToChange in the code below) comes with 2 separate files. File 1... (5 Replies)
Discussion started by: tiktak292
5 Replies
message(1F)							   FMLI Commands						       message(1F)

NAME
message - puts its arguments on FMLI message line SYNOPSIS
message [-t] [ -b [num]] [-o] [-w] [string] message [-f] [ -b [num]] [-o] [-w] [string] message [-p] [ -b [num]] [-o] [-w] [string] DESCRIPTION
The message command puts string out on the FMLI message line. If there is no string, the stdin input to message will be used. The output of message has a duration (length of time it remains on the message line). The default duration is "transient": it or one of two other dura- tions can be requested with the mutually-exclusive options below. Messages displayed with message -p will replace (change the value of) any message currently displayed or stored via use of the permanentmsg descriptor. Likewise, message -f will replace any message currently displayed or stored via use of the framemsg descriptor. If more than one message in a frame definition file is specified with the -p option, the last one specified will be the permanent duration message. The string argument should always be the last argument. OPTIONS
-t Explicitly defines a message to have transient duration. Transient messages remain on the message line only until the user presses another key or a CHECKWORLD occurs. The descriptors itemmsg , fieldmsg , invalidmsg , choicemsg , the default-if-not-defined value of oninterrupt , and FMLI generated error messages (that is, from syntax errors) also output transient duration messages. Tran- sient messages take precedence over both frame messages and permanent messages. -f Defines a message to have "frame" duration. Frame messages remain on the message line as long as the frame in which they are defined is current. The descriptor framemsg also outputs a frame duration message. Frame messages take precedence over permanent messages. -p Defines a message to have "permanent" duration. Permanent messages remain on the message line for the length of the FMLI session, unless explicitly replaced by another permanent message or temporarily superseded by a transient message or frame message. A per- manent message is not affected by navigating away from, or by closing, the frame which generated the permanent message. The descriptor permanentmsg also outputs a permanent duration message. -b[num] Rings the terminal bell num times, where num is an integer from 1 to 10. The default value is 1. If the terminal has no bell, the screen will flash num times instead, if possible. -o Forces message to duplicate its message to stdout . -w Turns on the working indicator. EXAMPLES
Example 1: A sample output of message on the message line: When a value entered in a field is invalid, ring the bell 3 times and then display Invalid Entry: Try again! on the message line: invalidmsg=`message -b 3 "Invalid Entry: Try again!"` Display a message that tells the user what is being done: done=`message EDITOR has been set in your environment` close Display a message on the message line and stdout for each field in a form (a pseudo-"field duration" message). fieldmsg="`message -o -f "Enter a filename."`" Display a blank transient message (effect is to "remove" a permanent or frame duration message). done=`message ""` nop ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
sleep(1), attributes(5) NOTES
If message is coded more than once on a single line, it may appear that only the right-most instance is interpreted and displayed. Use sleep(1) between uses of message in this case, to display multiple messages. message -f should not be used in a stand-alone backquoted expression or with the init descriptor because the frame is not yet current when these are evaluated. In cases where `message -f "string"` is part of a stand-alone backquoted expression, the context for evaluation of the expression is the previously current frame. The previously current frame can be the frame that issued the open command for the frame containing the back- quoted expression, or it can be a frame given as an argument when fmli was invoked. That is, the previously current frame is the one whose frame message will be modified. Permanent duration messages are displayed when the user navigates to the command line. SunOS 5.10 5 Jul 1990 message(1F)
All times are GMT -4. The time now is 08:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy