Я сделал два тестовых сценария bash для Linux, чтобы устранить проблему.
TestScript1 выглядит так: echo "TestScript1 Arguments:"
echo "$1"
echo "$2"
echo "$#"
./testscript2 $1 $2
TestScript2 выглядит так:
echo "TestScript2 Arguments received from TestScript1:"
echo "$1"
echo "$2"
echo "$#"
Когда я выполняю testcript1 следующим образом:
./testscript1 "Firstname Lastname" [email protected]
Желаемый результат должен быть:
TestScript1 Arguments:
Firstname Lastname
[email protected]
2
TestScript2 Arguments received from TestScript1:
Firstname Lastname
[email protected]
2
Но фактический результат:
TestScript1 Arguments:
Firstname Lastname
[email protected]
2
TestScript2 Arguments received from TestScript1:
Firstname
Lastname
3
Как решить эту проблему? Я хочу получить желаемый результат вместо фактического вывода.