Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4325270
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:14:38+00:00 2026-05-21T09:14:38+00:00

My objective is to simply to change a function call from one to another,

  • 0

My objective is to simply to change a function call from one to another, anywhere the first one is found, recursively. In this case, mysql_error( to mysql_error_to_log(.

In the past, I have successfully used the following grep & sed statement:

grep -rl connection1\.php ./ | xargs sed -i
    's/connection1\.php/account_db_user\.connection\.php/'

So this time I tried something similar (just a different character, (, being escaped):

grep -rl mysql_error\( ./ | xargs sed -i 's/mysql_error\(/mysql_error_to_log\(/'

but I receive this error:

sed: -e expression #1, char 37: Unmatched ( or \(

It seems to be telling me that my attempts to escape ( aren’t correct. I searched for an explanation for that sed issue on google, but didn’t find anything really clear. So what’s wrong with that command?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:14:39+00:00Added an answer on May 21, 2026 at 9:14 am

    You do not need to escape ( or ) in quoted strings on the shell, whether those strings are quoted with single '()' or double "()" quotes.

    The only reason the \( in the argument to grep works is because that string is not quoted.

    Remember that it is the shell which deals with the quotes (and with the \( of the unquoted strings), not the programs the shell actually calls (grep and xarg, in your case).

    So sed actually sees \( (not just (), and that has a special meaning in its regular expressions.

    My general advice would be to always quote strings on the shell whenever there might be a “funny” character in them, and thus avoid escaping characters from the shell altogether.

    As to the “old” example with the escaped dot \. – this appears to work, but one time you are escaping the dot from the shell (which would not be necessary but results in just a verbatim dot .), and the other time you escape the dot in a regular expression, where an unescaped dot has a special meaning, thus requiring the escaping to mean a verbatim dot.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My objective is to write a program which will call another executable on a
Looked for an answer for this question, but I haven't found a suitable one
I'm new with Objective-C, so there probably is a simple solution to this. I
Objective-C has no namespaces; it's much like C, everything is within one global namespace.
Objective: take a UIImage, crop out a square in the middle, change size of
My objective is to get the answer from up to 6000 Urls in the
I need to implement kind of illustrated function ( ratio = somefunction(time)) in Objective-c.
Is there a tool can change simple .xib to Objective-C code automatically? I want
My objective here is really simple -- I'm trying to set an NSString to
Objective : Make a progress bar where users can check how much of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.