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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:37:07+00:00 2026-06-01T06:37:07+00:00

Using a script, I was to change the prompt of the parent Bash shell.

  • 0

Using a script, I was to change the prompt of the parent Bash shell. I have tried the following:

PS1="Hello World > "

This changes the prompt of the subshell, which the script is running in, but which command would I use to change the prompt of the parent shell. Any ideas?

  • 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-01T06:37:08+00:00Added an answer on June 1, 2026 at 6:37 am

    In all cases the parent shell must cooperate. The child process in a unix environment cannot influence the parent process without its cooperation.

    Try this in the subshell script changePrompt.sh:

    echo 'PS1="Hello World > "'
    

    And then call the script from the parent shell like this:

    eval "$(changePrompt.sh)"
    

    Or, a different approach: Source the script instead of calling it. changePrompt.sh:

    PS1="Hello World > "
    

    Call it like this:

    source changePrompt.sh
    

    or simply:

    . changePrompt.sh
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've tried to change filenames using following script: find dir/ -type f -exec mv
You Have edited script according to v2 i am getting this error on using
I want a make a custom script.By using this script i want to change
I am writing a batch file script using Windows command and want to change
I'm using $().post and php to change the contents of a <textarea>. The script
Is it possible to make changes in mysql's my.ini file using PHP script?
I'm using this script to display all the images in a folder, but I
I am using this function in Bash function parse_git_branch { git_status=$(git status 2> /dev/null)
Steps to produce this: prompt>rails test_app prompt>cd test_app prompt>script/generate scaffold date_test my_date:datetime prompt>rake db:migrate
I'm currently using the script below to change an image on rollover. There are

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.