Powershell chmod on /tmp/hive for winutils and hadoop/spark

后端 未结 1 999
说谎
说谎 2021-01-26 03:27

I\'m currently trying to incorporate a process for setting up Spark/Hadoop on a teststack into our powershell script.

It\'s a windows environment and a few bits are thro

相关标签:
1条回答
  • 2021-01-26 04:12

    Using the PowerShell environment variable syntax ($env:VARIABLE) instead of the batch syntax (%VARIABLE%) should suffice. Note that you must use the call operator for this to work. I'd also recommend adding double quotes in case there are spaces in the path.

    & "${env:HADOOP_HOME}\bin\winutils.exe" chmod 777 /tmp/hive
    

    The need for the call operator appears to be due to PowerShell's command parser not recognizing an expression $variable\something as a path. Without the & you'd be getting an an exception

    Unexpected token '\bin\winutils.exe' in expression or statement.

    0 讨论(0)
提交回复
热议问题