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

The Archive Base Latest Questions

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

I am encountering a strange problem with my 64-bit Ubuntu – on the export

  • 0

I am encountering a strange problem with my 64-bit Ubuntu – on the export command.

Basically, I have got a VM installation on Ubuntu on my Windows 7 system, and I am trying to pass commands from my Windows system to my VM installation using a custom (given by client) software.

So, on my VM, when I do:

export foo=bar
echo $foo

everything works as expected.

However, when I do the same through the custom software (which basically passes the Linux command as a string to the bash shell), I get:

export: command not found

I tried looking at the shell (using the custom software), using:

echo $SHELL > shell.txt

And I get /bin/bash which is expected and I still get the "export: command not found error".

How can I fix this?

  • 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-01T22:51:38+00:00Added an answer on June 1, 2026 at 10:51 pm

    export is a Bash builtin, echo is an executable in your $PATH. So export is interpreted by Bash as is, without spawning a new process.

    You need to get Bash to interpret your command, which you can pass as a string with the -c option:

    bash -c "export foo=bar; echo \$foo"
    

    ALSO:

    Each invocation of bash -c starts with a fresh environment. So something like:

    bash -c "export foo=bar"
    bash -c "echo \$foo"
    

    will not work. The second invocation does not remember foo.

    Instead, you need to chain commands separated by ; in a single invocation of bash -c:

    bash -c "export foo=bar; echo \$foo"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am encountering a strange problem when trying to create two dropdowns where the
I'm encountering a very strange problem using g++ 4.1.2. I have a very basic
I am encountering a strange problem. I am trying to generate a matrix with
I am encountering a strange axis text alignment problem, as can be seen in
I am encountering a strange problem when attempting to execute a DELETE query agains
I am encountering a strange javascript regex problem on Firefox 3.6 and Chrome 6
I've been encountering some strange behavior when trying to find a key inside a
I´m encountering this problem trying to mock some objects that receive complex lambda expressions
I am encountering a strange problem with my script which I am testing to
As the title boasts, I'm encountering a rather strange problem with Firefox where it's

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.