Jump to content

How to echo environment variable in script


Recommended Posts

because global variable not work in terminal command

 

so I will transfer shell from script to command, but echo not work

 

```

echo "/Users/qhe/Documents/Shell/test_vpn.sh {var:code} {query} $MAC_PASSWORD $USERNAME $PASSWORD"

```

 

What's wrong.

 

variable and global variable not work

 

 

image.thumb.png.ac81b316fce99024496125f84dd8cb1f.png

image.png.7e9a2e0a0131d921f432bed32a91d95c.png

 

image.png.cd03acf9b04517c4be81245a4b227eb4.png

Edited by Alan He
Link to comment
1 hour ago, Alan He said:

{var:code}

Only the {query} macro is expanded in scripts.


I can’t tell you why “global variables” don’t work because I don't know what you mean, and can't check anything for myself with only screenshots to look at.

 

If your workflow isn’t working, upload it somewhere and post a link, so we can have a look for ourselves.

Link to comment

It's my fault, now, only {var:code} is not work when echo in script

 

I have pasted code.

 

 

8 hours ago, deanishe said:

Only the {query} macro is expanded in scripts.


I can’t tell you why “global variables” don’t work because I don't know what you mean, and can't check anything for myself with only screenshots to look at.

 

If your workflow isn’t working, upload it somewhere and post a link, so we can have a look for ourselves.

 

Edited by Alan He
Link to comment
17 minutes ago, deanishe said:

 

And I told you the obvious problem with the code. The other problem isn’t in the code.

 

 

The problem is  Only the {query} macro is expanded in scripts. 

 

Question is I need that variable  {var:code} 

 

One way is, I put it in the query, split inside the command

 

 

image.png.842ed983f6fa97b8de78e832b9ca81e8.png

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...