Sponsored Content
Top Forums Shell Programming and Scripting Problem with sed string substitution Post 302254287 by funksen on Tuesday 4th of November 2008 05:16:03 AM
Old 11-04-2008
Problem with sed string substitution

Hi,

heres my problem:


echo "aaaa(aaaa(aaa" | sed 's/a.*(//g'

gives aaa

but it should give aaaa(aaa


.*( should find any string to the appearance of (, but it finds any string to the last appearance, any idea why, and how to do this?

and what if the string ist
aaaa(aaaa(aaaa(aaa and i want to replace it to the second appearance


this is just a small example, but I hope it's clear what I mean


cheers

funksen
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sed String Substitution

Hi! I've the following script code with an input parameter: sed 's/oldstring/$1/g' myfile > newfile (I launch it with comman line: $ MyShell newstring) Problem: the substituion doesn't work (oldstring becomes $1, instead of newstring). How could I solve this situation? Thanks, ... (2 Replies)
Discussion started by: pciatto
2 Replies

2. UNIX for Dummies Questions & Answers

sed/awk String problem

I would appreciate it if any one can guide me in using awk perhaps sed in extracting some values from a long string. here is an example. .......some lines here........ ........ aaaa bbbb cccc ddddd eeeee fffff gggg (time:hhhh)........ ......some lines here also.......... How can I extract... (2 Replies)
Discussion started by: odogbolu98
2 Replies

3. Shell Programming and Scripting

Sed - substitution for whole string

Hello I have several files where a string similar to this appears: /home/workload/bin/ProcDly/scrpts/T54.sh > $LOG I need to change it to something like this: $VARIABLE > $LOG However, due to the configuration of the rest of the files, I should only find this string by the... (4 Replies)
Discussion started by: Scarlos
4 Replies

4. Shell Programming and Scripting

sed problem - replacement string should be same length as matching string.

Hi guys, I hope you can help me with my problem. I have a text file that contains lines like this: 78 ANGELO -809.05 79 ANGELO2 -5,000.06 I need to find all occurences of amounts that are negative and replace them with x's 78 ANGELO xxxxxxx 79... (4 Replies)
Discussion started by: amangeles
4 Replies

5. Shell Programming and Scripting

sed substitution problem

Can anyone please help me on this. i have a file with lines say X X3200 X X X X2400 X X4100 I want to use sed to put the numbers in braces. the output should be like, X X(3200) X X X X(2400) X X(4100) (7 Replies)
Discussion started by: diliphp
7 Replies

6. Shell Programming and Scripting

problem with sed while replacing a string with another

Hi, I have a line something like this sys,systematic,system I want to replace only the word system with HI I used sed for this as below echo sys,systematic,system | sed 's/system/HI/' but I got output as sys,HIatic,system I wanted output as sys,systematic,HI Please tell me... (9 Replies)
Discussion started by: friendyboy
9 Replies

7. Shell Programming and Scripting

sed variable substitution problem

Hi, I am facing a strange problem. I have a script that used the following to search and replace text: sed 's/'"${find_var_parm}"'/'"${find_var_filter}"'/g' $ParmFile > $TempFile The values of $find_var_parm and $find_var_filter are set based on search criteria. The above seems to be working... (2 Replies)
Discussion started by: arsh
2 Replies

8. Shell Programming and Scripting

sed substitution problem

I'm writing my first script and I have all the other commands I'm using working properly, but I'm having one final issue with a sed. I've looked on the forums for some answers, which have been close but sed is quite confusing to me. My problem is that I have a file called CylinderAtom1.txt... (3 Replies)
Discussion started by: 1Aegis1
3 Replies

9. Shell Programming and Scripting

Problem with substitution in sed??

Hi alll I have a file with this content ale,AAM,id2_1_2_1_1,23,2013-01-30,1,1 ale,BAND,id2_1_1_1_1,31,2013-01-28,1,1 ale,CAI,id2_1_1_1_1,23,2013-01-28,1,1 ale,CAI,id2_1_1_1_4,23,2013-01-28,1,1 ale,CAI,id2_1_2_1_1,23,2013-01-30,2,1 ale,NAST,id2_1_1_1_1,23,2013-01-29,1,1... (1 Reply)
Discussion started by: nikhil jain
1 Replies

10. Shell Programming and Scripting

sed - String substitution within specified section in ini type file

Hello. I am trying to modify a config file which is in windows *.ini type file. I have found a piece of code here :linux - Edit file in unix using SED - Stack Overflow As I can't make it doing the job , I am trying to find a solution step by step. here a modified sample file : my_sample.ini... (1 Reply)
Discussion started by: jcdole
1 Replies
gnome-appearance-properties(1)					   User Commands				    gnome-appearance-properties(1)

NAME
gnome-appearance-properties - configure GNOME desktop appearance SYNOPSIS
gnome-appearance-properties [--install-theme=file] [--show-page=page] [gnome-std-options] DESCRIPTION
The GNOME appearance preference tool enables you to select how your GNOME desktop is themed. The theme controls the appearance of GNOME- compliant application interface items. For example, the theme affects the appearance of buttons, scrollbar, check boxes, and so on. This preference tool can also be used to configure the background image, fonts used by the desktop, and the visual appearance of the GNOME panel. OPTIONS
The following options are supported: -i, --install-theme=file Installs the specified theme file. -p, --show-page=page Specify the page, or tab, to display. The value can be: theme, background, fonts, or interface. gnome-std-options Standard options available for use with most GNOME applications. See gnome-std-options(5) for more infor- mation. EXAMPLES
Example 1: Launching the gnome-appearance-properties tool example% gnome-appearance-properties EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/gnome-appearance-properties Executable for gnome-appearance-properties ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-desktop-prefs | +-----------------------------+-----------------------------+ |Interface stability |Volatile | +-----------------------------+-----------------------------+ SEE ALSO
Preference Tools Manual Latest version of the GNOME Desktop User Guide for your platform. gnome-control-center(1), attributes(5) gnome-std-options(5) NOTES
Written by Glynn Foster, updated by Brian Cameron, Sun Microsystems Inc., 2003, 2007. SunOS 5.11 09 Nov 2007 gnome-appearance-properties(1)
All times are GMT -4. The time now is 11:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy