M
M
Maxim Ivanov2017-01-05 01:21:18
bash
Maxim Ivanov, 2017-01-05 01:21:18

How to get a variable from outside bash script?

There is something like this file
path.sh

#!/bin/bash
result="test/auth_dist"
echo $result

Conditionally, the script gives the path to the directories, how can I make it so that I can get a variable from this script, for its execution in the future for the rimraf commands (from npm) or rm -rf
But it is clear that this syntax is incorrect, but how can this be implemented ?
$ rm -rf $(sh path.sh)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xotkot, 2017-01-05
@splincodewd

$catpath.sh

#!/bin/bash
path1="путь1"
path2="путь1"

$ . ./path.sh
$ rm -rf $path1 $path2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question