Getting variables from a bash script and use them in an Arduino code

Hi there,

I'm newbie here and I'm trying to make a project, in which I have some files with bash scripts (username and password variables), and I have an arduino code in which I want to use those external variables (username and password) like:

    const char *username = ${USERNAME-EXTERNAL-VARIABLE};
    const char *password= ${PASSWORD-EXTERNAL-VARIABLE};

Could anyone help me? Thank you so much!

No need to apologize and welcome to the forums! You can use something like:

char * getenv (const char *USERNAME) 

It will return a string with the value of the environment variable USERNAME.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.