I would like to reference a variable that I have in a bash script “value” as well as “max.” As of now, I have a text interface in which after given commands, the terminal window displays something similar to
==========================================================================> 100%
for a progress bar. The variable is referenced throughout the script, and I would like to call that variable in my cocoa app.
Thanks in advance!
Your question isn’t entirely clear, but it sounds like you want to use environment variables. In bash, you need to use the
exportbuiltin to mark a variable to be exported to child processes. Then, in your Cocoa app, you can usegetenv(3)function to retrieve the environment variable value. For example: