LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-29-2012, 11:44 AM   #1
acconboy
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Rep: Reputation: Disabled
Question Sed command syntax incorrect


ps -ef | grep qemu | sed -e '/ -/([^ ]/)/\n\t-\1/g'
only returns sed: -e expression #1, char 5: unknown command: `('
 
Old 03-29-2012, 07:15 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi, welcome to LQ!

I split your post out of the unrelated thread in the unrelated forum, and moved
it to Newbie.

If you were trying to escape the parentheses () you need to use back-slashes \, not slashes /.


Maybe you should explain what your sed expression is trying to achieve =o)

Cheers,
Tink

Last edited by Tinkster; 03-29-2012 at 07:16 PM.
 
Old 03-29-2012, 07:18 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
You might also find it handy to use an alternative separation char eg ':' instead of '/', a nice feature of sed to avoid https://en.wikipedia.org/wiki/Leanin...hpick_syndrome
 
Old 04-06-2012, 02:56 PM   #4
acconboy
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Actually, it was in response

to a command posted by a user in the thread it was in. I was getting errors with the syntax he had posted. will try the : instead of the /
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] head -n -1 (sed -n -e '1,$-1p' is incorrect) sed question, as stupid as it could be. kaz2100 Programming 1 12-27-2011 10:18 PM
Incorrect syntax in grub.cfg, or damaged boot sector? sonichedgehog Linux - Software 3 03-31-2011 12:44 PM
[SOLVED] sed between command syntax tnrooster Linux - Software 9 01-31-2011 09:08 PM
[SOLVED] Question about sed syntax in bash script musonio Linux - Software 2 08-21-2009 08:17 AM
Another SED Syntax Question... stlouis Programming 3 01-17-2008 09:50 PM


All times are GMT -5. The time now is 04:56 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration