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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:21:35+00:00 2026-06-03T04:21:35+00:00

I am unable to make even the simplest export of variables, from within scripts,

  • 0

I am unable to make even the simplest export of variables, from within scripts, to work in my bash – what am I dooing wrong?

File test.sh :

#!/bin/bash
echo $ttt
ttt="fffalse"
export ttt
echo $ttt

bash test :

hpek@hpek:~/temp$ export ttt="tttrue"
hpek@hpek:~/temp$ ./test.sh 
tttrue
fffalse
hpek@hpek:~/temp$ ./test.sh 
tttrue
fffalse
hpek@hpek:~/temp$ 

Edit:

I now know from the answers, that this will not work. -but how can make a single variable remembered between processes? Do I need to store it in a file?

  • 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-03T04:21:37+00:00Added an answer on June 3, 2026 at 4:21 am

    ./test.sh is the same as bash test.sh

    Each shell script running is, in effect, a subprocess (child process) of the parent shell.
    And subprocess cannot export env-var to it’s parent.


    You can try this(run in the same environment):

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

Sidebar

Related Questions

I've been unable to make this work because of what I believe is a
I'm struggling to make Glassfish 3.1.1 to log to syslog, but I'm unable to.
Error: Unable to read data from the transport connection: A blocking operation was interrupted
I'm unable to add an mdf database file by right clicking on the project
I have to make a folder from a servlet in the project's web directory.
I've had this problem numerous times with even the simplest layouts. It seems that
I have a problem I am unable to solve even though I spend long
I'm trying to use OSMdroid for a project, and i'm utterly unable to make
I'm trying to make a JFrame with a usable content area of exactly 500x500.
Unable to cast object type System.Collections.Generic.List 1[NorthwindMVC3.Models.Product] to the type ofSystem.Collections.Generic.IEnumerator 1[NorthwindMVC3.Models.Product].\ public IEnumerator<Product>

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.