Calling one Bash script from another Script passing it arguments with quotes and spaces

前端 未结 3 1704
渐次进展
渐次进展 2020-12-23 13:17

I made two test bash scripts on Linux to make the problem clear.

TestScript1 looks like:
    echo \"TestScript1 Arguments:\"
    echo \"$1\"
             


        
3条回答
  •  [愿得一人]
    2020-12-23 13:59

    Quote your args in Testscript 1:

    echo "TestScript1 Arguments:"
    echo "$1"
    echo "$2"
    echo "$#"
    ./testscript2 "$1" "$2"
    

提交回复
热议问题