How to get a variable to have the current dir path?
This question already has an answer here:
When you want to set a variable, you don't use the $ :
currentdir=`pwd`
The $ is for when you want to do a variable substitution.
Assigning to a variable is without the '$' sign. Using the value is with the '$' sign.
currentdir=`pwd`
try:
currentdir=`pwd`
(remove the $ )
上一篇: 将MySQL“SELECT”查询传递给shell变量
下一篇: 如何让变量具有当前目录路径?
