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

  • Home
  • SEARCH
  • 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 8185369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:49:28+00:00 2026-06-07T01:49:28+00:00

I currently have echo -n MySQL Database Name: ; read MyVar; sed -i ‘s/database_name_here/$MyVar/g’

  • 0

I currently have

echo -n "MySQL Database Name:  "; read MyVar; sed -i 's/database_name_here/$MyVar/g' config.php

It partially works, it prompts me to enter a database name. Once entered it updates the file but it’s still putting $MyVar instead of what’s typed.

echo -n "MySQL Database Name:  "; read MyVar; echo "$Myvar"

^ works just fine.

Any ideas?

UPDATE:

echo -n MySQL Database Name: ; read MyVar; sed -i s/database_name_here/$MyVar/g config.php
# ////
echo -n MySQL Username: ; read usr; sed -i s/username_here/$usr/g config.php
# ////
echo -n MySQL Password: ; read blackberg; sed -i s/password_here/$blackberg/g config.php

If it’s just one line on the bash it works and replaces the value.
But when I have the above, it works partially but replaces the values with blank.

Any tips?

  • 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-06-07T01:49:30+00:00Added an answer on June 7, 2026 at 1:49 am
    sed -i "s/database_name_here/$MyVar/g" config.php
    

    to ask shell to interpret the variable, you need to use double quotes instead.

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

Sidebar

Related Questions

Currently I have this code: <?php echo '<meta name=robots content=noindex>'; $arr = json_decode(file_get_contents(http://media1.clubpenguin.com/play/en/web_service/game_configs/ paper_items.json),true);
I have a mysql database table to store country name and currency symbol -
I have a PHP search suggestion script which uses a MySQL database as its'
I have a mysql database with two tables: table1 (id, name, emailid) table2 (id,
I currently have a form with inputs and name attributes. I'm able to get
I currently have a MySQL table like: id | friend 1 | 2 1
I've been trying my hand at OO PHP, and currently have three files. I
I have a php script that tries to find a particular name in a
Hi I am exporting my mysql data in excel format currently I have 14k+
I have a MySQL database containing a user's country and whether they are an

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.