Skip to main content
Became Hot Network Question
correct incorrect word.
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113

Let's say I am in a Bash script and am sourcing a file. How do I pass argumentsvariables to another script after I source the file like this.

sed -i 's/ = /=/' $file
source $file

Let's say file contains

variable1=10
variable2=apple

If I want to use these in another script, how do I pass these arguments to the other script, then run the script in my current Bash script.

Let's say I am in a Bash script and am sourcing a file. How do I pass arguments to another script after I source the file like this.

sed -i 's/ = /=/' $file
source $file

Let's say file contains

variable1=10
variable2=apple

If I want to use these in another script, how do I pass these arguments to the other script, then run the script in my current Bash script.

Let's say I am in a Bash script and am sourcing a file. How do I pass variables to another script after I source the file like this.

sed -i 's/ = /=/' $file
source $file

Let's say file contains

variable1=10
variable2=apple

If I want to use these in another script, how do I pass these arguments to the other script, then run the script in my current Bash script.

edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 265
Source Link
user317784
user317784

Passing arguments from one script to another

Let's say I am in a Bash script and am sourcing a file. How do I pass arguments to another script after I source the file like this.

sed -i 's/ = /=/' $file
source $file

Let's say file contains

variable1=10
variable2=apple

If I want to use these in another script, how do I pass these arguments to the other script, then run the script in my current Bash script.