Sponsored Content
Top Forums Shell Programming and Scripting unable to use new line in sed search pattern. Post 302442790 by success on Thursday 5th of August 2010 12:40:49 PM
Old 08-05-2010
unable to use new line in sed search pattern.

hi ,
my lilo.conf is as shown below :
Code:
prompt
    default=Primary
    read-only

image=/boot/bzImage
    label=Primary
    root=/dev/md0
    append="reboot=t md=0 ip=off panic=5 quiet console=ttyS0,115200n81"
    read-only

image=/boot/bzImage
    label=Recover
    root=/dev/sda3
    append="reboot=t ep=off panic=5 quiet console=ttyS0,115200n81"

image=/boot/bzImage
    label=SecRoot
    root=/dev/sda2
    append="reboot=t ip=off panic=5 quiet console=ttyS0,115200n81"

i am writing a tool which takes as input Primary/SecRoot/Recover, based on which i should replace the line "image=/boot/bzImage".

For example if i give SecRoot as input then

image=/boot/bzImage
label=SecRoot

should get replaced by

image=/secroot/boot/bzImage
label=SecRoot

I tried many options of sed, but could not correctly implement it. any help is greatly appreciated.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SED Search Pattern and Replace with the Pattern

Hello All, I have a string "CP_STATUS OSSRC_R6_0_Shipment_R1H_CU AOM_901046 R1H_LLSV1_2008031", and I just want to extract LLSV1, but I dont get the expected result when using the sed command below. # echo "CP_STATUS OSSRC_R6_0_Shipment_R1H_CU AOM_901046 R1H_LLSV1_2008031" | awk '{print... (4 Replies)
Discussion started by: racbern
4 Replies

2. UNIX for Dummies Questions & Answers

modify a particular pattern starting from second line of the search pattern

Hi, I am new to this forum and i would like to get help in this issue. I have a file 1.txt as shown: apple banana orange apple grapes banana orange grapes orange .... Now i would like to search for pattern say apple or orange and then put a # at the beginning of the pattern... (2 Replies)
Discussion started by: imas
2 Replies

3. UNIX for Dummies Questions & Answers

modify a particular pattern starting from second line of the search pattern

Hi, I think you ppl did not get my question correctly, let me explain I have 1.txt with following entries as shown: 0152364|134444|10.20.30.40|015236433 0233654|122555|10.20.30.50|023365433 ** ** ** In file 2.txt I have the following entries as shown: ... (1 Reply)
Discussion started by: imas
1 Replies

4. Shell Programming and Scripting

sed: Find start of pattern and extract text to end of line, including the pattern

This is my first post, please be nice. I have tried to google and read different tutorials. The task at hand is: Input file input.txt (example) abc123defhij-E-1234jslo 456ujs-W-abXjklp From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Discussion started by: TestTomas
5 Replies

5. Shell Programming and Scripting

SED Question: Search and Replace start of line to matching pattern

Hi guys, got a problem here with sed on the command line. If i have a string as below: online xx:wer:xcv: sdf:/asdf/http:https-asdfd How can i match the pattern "http:" and replace the start of the string to the pattern with null? I tried the following but it doesn't work: ... (3 Replies)
Discussion started by: DrivesMeCrazy
3 Replies

6. Shell Programming and Scripting

How to search pattern and add that pattern in next line

Hi All, I am new to shell scripting and need help in scripting using CSH. Here is what I am trying to so, 1. Search a specific string e.g. "task" from "task (input1, out1)". 2. Extract the arguements "input1" and "out1" 3. Add them in separate lines below. eg. "int input1" , " integer out1" ... (7 Replies)
Discussion started by: deshiashish
7 Replies

7. Homework & Coursework Questions

sed Multiple Pattern search and delete the line

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have file which has got the following content sam 123 LD 41 sam 234 kp sam LD 41 kam pu sam LD 61 Now... (1 Reply)
Discussion started by: muchyog
1 Replies

8. Shell Programming and Scripting

How to use sed to search a particular pattern in a file backward after a pattern is matched.?

Hi, I have two files file1.txt and file2.txt. Please see the attachments. In file2.txt (which actually is a diff output between two versions of file1.txt.), I extract the pattern corresponding to 1172c1172. Now ,In file1.txt I have to search for this pattern 1172c1172 and if found, I have to... (9 Replies)
Discussion started by: saurabh kumar
9 Replies

9. Shell Programming and Scripting

Search a pattern in a line and remove another pattern

Hi, I want to search a pattern in a text file and remove another pattern in that file. my text file look like this 0.000000 1.970000 F 303 - 1.970000 2.080000 VH VH + 2.080000 2.250000 VH VH + 2.250000 2.330000 VH L - 2.330000 2.360000 F H + 2.360000 2.410000 L VL - 2.410000 ... (6 Replies)
Discussion started by: sreejithalokkan
6 Replies

10. Shell Programming and Scripting

Sed: printing lines AFTER pattern matching EXCLUDING the line containing the pattern

'Hi I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match. Which option is to be used to exclude the line containing the pattern? sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies
cdvd(1) 						      General Commands Manual							   cdvd(1)

NAME
cdvd - Read Primary Volume Descriptor from a CD-ROM SYNOPSIS
/usr/bin/cdvd [-b] file OPTIONS
Copies the entire Primary Volume Descriptor from a CD-ROM in binary format to standard output. Names the block special file for a CD-ROM File System, or a file or directory within the CD-ROM file hierarchy of a mounted CD-ROM File System. DESCRIPTION
The cdvd command reads the Primary Volume Descriptor from a CD-ROM and lists the contents on standard output. The output is formatted in a table that contains the name of each field of the Primary Volume Descriptor and the corresponding contents of the entry as recorded on the CD-ROM. Note that the Application Use Field is not listed because it may contain non-printable characters. Users must have read permission for file in order to execute the command. EXIT STATUS
The following exit values are returned: The command was successful. The named file was not found, or was not within the CD-ROM hierarchy, or not a block special file for a CD-ROM File System, or access permission was denied. The named file is a block special file and a read error has occurred, or the CD-ROM is not recorded according to the ISO 9660 standard. SEE ALSO
Files: cd_cpvd(3), cd_pvd(3) cdvd(1)
All times are GMT -4. The time now is 03:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy