Skip to main content
deleted 1 character in body; edited tags
Source Link
Quasímodo
  • 19.4k
  • 4
  • 42
  • 78

I run the following script:

VAR="Test" sh -c 'echo "Hello $VAR"' 

But I get  :

# ./test.sh Hello 

How can I send the variable VAR of my script to the shell created with sh -c '...'?

I run the following script:

VAR="Test" sh -c 'echo "Hello $VAR"' 

But I get  :

# ./test.sh Hello 

How can I send the variable VAR of my script to the shell created with sh -c '...'?

I run the following script:

VAR="Test" sh -c 'echo "Hello $VAR"' 

But I get:

# ./test.sh Hello 

How can I send the variable VAR of my script to the shell created with sh -c '...'?

added 4 characters in body; edited title
Source Link
αғsнιη
  • 42k
  • 17
  • 75
  • 118

How to "send"send variable to suban inline shell-shellscript?

I run the following script:

VAR="Test" sh -c 'echo "Hello $VAR"' 

But I get :

# ./test.sh Hello 

How can I "send"send the variable VAR of my script to the shell created with sh -c '...'?

How to "send" variable to sub-shell?

I run the following script:

VAR="Test" sh -c 'echo "Hello $VAR"' 

But I get :

# ./test.sh Hello 

How can I "send" the variable VAR of my script to the shell created with sh -c?

How to send variable to an inline shell-script?

I run the following script:

VAR="Test" sh -c 'echo "Hello $VAR"' 

But I get :

# ./test.sh Hello 

How can I send the variable VAR of my script to the shell created with sh -c '...'?

Tweeted twitter.com/#!/StackUnix/status/128503535871602688
Source Link
Matthieu Napoli
  • 1.2k
  • 2
  • 12
  • 14

How to "send" variable to sub-shell?

I run the following script:

VAR="Test" sh -c 'echo "Hello $VAR"' 

But I get :

# ./test.sh Hello 

How can I "send" the variable VAR of my script to the shell created with sh -c?