Sponsored Content
Top Forums Shell Programming and Scripting unable to use new line in sed search pattern. Post 302443008 by ygemici on Friday 6th of August 2010 08:07:27 AM
Old 08-06-2010
Code:
# var="SecRoot" ; sed "/image=\/boot\/bzImage/{s/=\(.*\)$/=\/"$(echo $var|sed 'y/PRS/prs/')"\1/}" infile
prompt
    default=Primary
    read-only
image=/secroot/boot/bzImage
    label=Primary
    root=/dev/md0
    append="reboot=t md=0 ip=off panic=5 quiet console=ttyS0,115200n81"
    read-only
image=/secroot/boot/bzImage
    label=Recover
    root=/dev/sda3
    append="reboot=t ep=off panic=5 quiet console=ttyS0,115200n81"
image=/secroot/boot/bzImage
    label=SecRoot
    root=/dev/sda2
    append="reboot=t ip=off panic=5 quiet console=ttyS0,115200n81"

 

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
LILO-UUID-DISKID(8)						lilo documentation					       LILO-UUID-DISKID(8)

NAME
lilo-uuid-diskid - convert boot / root options to diskid and uuid in lilo.conf. SYNOPSIS
lilo-uuid-diskid [-h] [-v] [lilo.conf] DESCRIPTION
This script looks for the boot block device or boot partition and create the right diskid or uuid as boot option. Then it looks for all root partitions and create the right uuids as root options. These conversions are necessary for use with newer kernel (>= 2.6.26) if it use the libata module for parallel and serial ATA interfaces of block devices (i. e. hard disks with IDE or SATA interface, usbsticks). OPTIONS
-h Print a brief help. -v Print verbose messages. EXAMPLES
Lines in the configuration file /etc/lilo.conf: #boot = /dev/sda boot = /dev/disk/by-id/ata-SAMSUNG_SV1604N_S01FJ10X999999 #root = /dev/sda1 root = "UUID=/dev/disk/by-uuid/18843936-00f9-4df0-a373-000d05a5dd44" COPYRIGHT and LICENSE Copyright (C) 2010-2011 Joachim Wiedorn This script is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. On Debian systems, the complete text of the GNU General Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'. AUTHOR
lilo-uuid-diskid was written by Joachim Wiedorn. This manual page was written by Joachim Wiedorn <ad_debian at joonet.de> for the Debian project (and may be used by others). SEE ALSO
lilo(8), update-lilo(8), liloconfig(8) 23.1 2011-03-20 LILO-UUID-DISKID(8)
All times are GMT -4. The time now is 04:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy