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 8530547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:16:23+00:00 2026-06-11T09:16:23+00:00

I have a pretty strange problem with sed , if I do with this:

  • 0

I have a pretty strange problem with sed, if I do with this:

[root@Camel ~]-> sed -i 's/TLRAGENT_IP=.*/TLRAGENT_IP='"${HOST_IP}"'/' ~user/.bash_profile

it’s fine. But if I try the following:

[root@Camel ~]-> CONF_FILE="~user/.bash_profile"
[root@Camel ~]-> sed -i 's/TLRAGENT_IP=.*/TLRAGENT_IP='"${HOST_IP}"'/' ${CONF_FILE}
sed: can't read ~user/.bash_profile: No such file or directory

also tried to quote the variable:

[root@Camel ~]-> sed -i 's/TLRAGENT_IP=.*/TLRAGENT_IP='"${HOST_IP}"'/' "${CONF_FILE}"
sed: can't read ~user/.bash_profile: No such file or directory

couldn’t figure out where went wrong, please advise.

Shell’s version is 3.2.25(1)-release.

  • 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-11T09:16:25+00:00Added an answer on June 11, 2026 at 9:16 am

    from man bash /EXPANSION

    EXPANSION
     Expansion is performed on the command line after it has been
     split  into  words.  There are seven kinds of expansion per-
     formed:  brace expansion,  tilde  expansion,  parameter  and
     variable  expansion, command substitution, arithmetic expan-
     sion, word splitting, and pathname expansion.
    
     The order of expansions is: brace  expansion,  tilde  expan-
     sion,  parameter, variable and arithmetic expansion and com-
     mand substitution (done in a  left-to-right  fashion),  word
     splitting, and pathname expansion.
    

    The parameter and variable expansion comes after tilde expansion

    To have tilde expansion, this can be done at variable definition

    CONF_FILE=~user/.bash_profile
    

    instead of

    CONF_FILE="~user/.bash_profile"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a pretty strange problem. I have a book that I have been
I have a pretty strange HTML problem I have never experienced before. I have
I have a very strange problem. I'm making a pretty standard ajax-call with jQuery,
I have a pretty weird problem related to zend framework's zend_db. I use $this
I have a pretty strange problem with jQuery: I have a website (with Flask)
This is a pretty strange issue so bear with me. I have a stored
I have a very strange situation. I´m working on a pretty big Java application
I have pretty simple jquery code : $(document).ready(function(){ $('img.marqFl').on({ mouseenter: function() { $(this).animate({height: 300},
I have built a PHP calendar system and have pretty much everything done but
My IE is IE 6. It's pretty old, but I have to use it.

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.