Aaron Perry
Aaron Perry

Reputation: 1051

Passing List of Variables In Bash To External Program

Good Afternoon Everyone,

This is probably a no-brainer but, I'm currently having issues passing a variable to a program in my bash script.

Here's what I'm trying to do:

regions=ne,se,vt,ma,sw,nw and so on and so forth

After that variable has been defined in my bash script, I'd then like to pass that variable into GrADS, where my script will read each of the regions one after the other until it reaches the end.

Upvotes: 1

Views: 248

Answers (1)

RICK
RICK

Reputation: 273

The most reliable means of passing variables I've found is to generate a text file with the code (or just the string) you want to pass from within the code. Alternatively, you could call GrADS (?) from within whatever program is generating the variable, and pass "$regions" as an argument.

Upvotes: 1

Related Questions