LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-19-2001, 03:23 PM   #1
Griffon26
Member
 
Registered: Sep 2001
Location: The Netherlands
Distribution: Gentoo, Debian, Mandrake, LFS
Posts: 182

Rep: Reputation: 30
Question Replacing "function(x)" with "x" using sed/awk/smth


Subject says it all.





I can find the matches with the regular expression "function(.*)", but how do I grab the .* part of the match and send it to the output? So far I've only been able to use the entire match (not very useful if you want to remove instead of add something).

Last edited by Griffon26; 10-19-2001 at 05:44 PM.
 
Old 11-22-2006, 11:04 AM   #2
zefo
Member
 
Registered: Mar 2003
Posts: 71

Rep: Reputation: 15
how about this? echo "function(x)" | sed -e "s/function(\(.*\))/\1/"
 
Old 11-22-2006, 11:31 AM   #3
Griffon26
Member
 
Registered: Sep 2001
Location: The Netherlands
Distribution: Gentoo, Debian, Mandrake, LFS
Posts: 182

Original Poster
Rep: Reputation: 30
I appreciate your effort, but it's been 6 years.
In the mean time I've learned a thing or two about linux, so I could've answered my own question ;-)
 
Old 11-22-2006, 11:47 AM   #4
zefo
Member
 
Registered: Mar 2003
Posts: 71

Rep: Reputation: 15
that's allright. i am only practicing script making today.. :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 12:26 PM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 04:07 PM
When "function pointer" meets "template"... I can't get rid of this compiling er cyu021 Linux - Software 3 12-17-2004 08:52 PM
"Function not implemented" error in call to "sem_open()" Krishnendu8 Linux - Newbie 1 06-07-2003 03:52 AM
"Function not imlemented" error in call to "sem_open()" Krishnendu8 Linux - Networking 0 06-07-2003 03:19 AM


All times are GMT -5. The time now is 02:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration