Sponsored Content
Top Forums Shell Programming and Scripting Can't find the mistake in sed expression Post 302288031 by vgersh99 on Monday 16th of February 2009 09:30:10 AM
Old 02-16-2009
Code:
$ echo 'iface eth0 inet wathever foo' | sed '/^iface eth0 inet / s/^\(iface eth0 inet\).*/\1 static/'
iface eth0 inet static

Code:
$ echo 'iface eth0 inet wathever foo' | sed '/^iface eth0 inet / s/^\(iface eth0 inet\) *\([^ ][^ ]*\) *\(.*\)/\1 static \3/'
iface eth0 inet static foo

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Dont what this sed expression does

I am new to unix and have come across the sed expression but not sure what its doing. Can someone please tell me whats happening in the sed command below? (2 Replies)
Discussion started by: 5211171
2 Replies

2. Shell Programming and Scripting

Do not find the mistake in a small routine!!!

Have a textfile (regular updated) with informations about datafiles . Each line is describing a datafile. Now I am trying to delete several specific lines in this textfile, which are defined before in a kind of removal list. Can not find the mistake I have done in the script because in the... (5 Replies)
Discussion started by: jurgen
5 Replies

3. Shell Programming and Scripting

Find, regular expression, anyway to simplify this find command?

Hello everyone, first post here, trying to learn scripting on my own and this forum as been really helpful so far. I made few little scripts working great but I m facing some problems with RE. I have a bunch of files in many subdirectories called *001.ext *002.ext OR simple *.ext or *01.ext... (7 Replies)
Discussion started by: Sekullos
7 Replies

4. Shell Programming and Scripting

Can anyone find the mistake in this script file

#!/bin/ksh db_user=`echo $DB_USER_NAME` db_pwd=`echo $DB_PASSWORD` db_sid=`echo $TWO_TASK` sqlplus -s $db_user/$db_pwd@$db_sid << EOF a = select ACK_PARTY_NAME,bus_event_seq_nbr from bus_event where ack_party_name like 'MOVE_USAGE_DAEMON%' and bus_event_seq_nbr='3969094' set -- echo $a |... (17 Replies)
Discussion started by: rkrish
17 Replies

5. UNIX for Advanced & Expert Users

sed: -e expression #1, char 0: no previous regular expression

Hello All, I'm trying to extract the lines between two consecutive elements of an array from a file. My array looks like: problem_arr=(PRS111 PRS213 PRS234) j=0 while } ] do k=`expr $j + 1` sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt ---some operation goes... (11 Replies)
Discussion started by: InduInduIndu
11 Replies

6. Shell Programming and Scripting

sed returns error "sed: -e expression #1, char 18: unterminated `s' command"

Hello All, I have something like below LDC100/rel/prod/libinactrl.a LAA2000/rel/prod/libinactrl.a I want to remove till first forward slash that is outputshould be as below rel/prod/libinactrl.a rel/prod/libinactrl.a How can I do that ??? (8 Replies)
Discussion started by: anand.shah
8 Replies

7. Shell Programming and Scripting

I am learning regular expression in sed,Please help me understand the use curly bracket in sed,

I am learning SED and just following the shell scripting book, i have trouble understanding the grep and sed statement, Question : 1 __________ /opt/oracle/work/antony>cat teledir.txt jai sharma 25853670 chanchal singhvi 9831545629 anil aggarwal 9830263298 shyam saksena 23217847 lalit... (7 Replies)
Discussion started by: Antony Ankrose
7 Replies

8. Shell Programming and Scripting

sed regular expression

Hi , I need to remove pipe character from a |^ delimeted file. Something like |^tran|sformers||^|revenge |of fallen|^ to |^transformers|^revenge of fallen|^... Cold anybody please help to build the regular expression using sed . many thanks. Please use code tags next time for... (1 Reply)
Discussion started by: kokjek
1 Replies

9. Shell Programming and Scripting

How to find a value from an expression?

I have below expression from which I would like to output +m= value: "ginger bread.k +log ../output1 -format +m=3 0 +sleep 10 +suspend 10" The output value should be "3" Any suggestions? (2 Replies)
Discussion started by: bskumarb4u
2 Replies
Sys::Virt::Interface(3pm)				User Contributed Perl Documentation				 Sys::Virt::Interface(3pm)

NAME
Sys::Virt::Interface - Represent & manage a libvirt host network interface DESCRIPTION
The "Sys::Virt::Interface" module represents a host network interface allowing configuration of IP addresses, bonding, vlans and bridges. METHODS
my $name = $iface->get_name() Returns a string with a locally unique name of the network $iface->is_active() Returns a true value if the interface is currently running my $name = $iface->get_mac() Returns a string with the hardware MAC address of the interface my $xml = $iface->get_xml_description() Returns an XML document containing a complete description of the network's configuration $iface->create() Start a network whose configuration was previously defined using the "define_network" method in Sys::Virt. $iface->undefine() Remove the configuration associated with a network previously defined with the "define_network" method in Sys::Virt. If the network is running, you probably want to use the "shutdown" or "destroy" methods instead. $iface->destroy() Immediately terminate the machine, and remove it from the virtual machine monitor. The $iface handle is invalid after this call completes and should not be used again. CONSTANTS
XML CONSTANTS The following constants are used when querying XML Sys::Virt::Interface::XML_INACTIVE Request the inactive XML, instead of the current possibly live config. AUTHORS
Daniel P. Berrange <berrange@redhat.com> COPYRIGHT
Copyright (C) 2006-2009 Red Hat Copyright (C) 2006-2007 Daniel P. Berrange LICENSE
This program is free software; you can redistribute it and/or modify it under the terms of either 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), or, the Artistic License, as specified in the Perl README file. SEE ALSO
Sys::Virt, Sys::Virt::Error, "http://libvirt.org" perl v5.14.2 2012-05-21 Sys::Virt::Interface(3pm)
All times are GMT -4. The time now is 06:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy