1
是写作shell脚本中的新变量。当我每次执行下面的程序中,我得到“$ userInput1 = /家庭/ XY-X/DEST1:没有这样的文件或目录”无法将变量设置为路径
fun1()
{
.
.
$2=$userInputPath'/*' #$userInputPath holds a path like /home/xyx/dest1
.
.
}
正在使用Bourne shell和调用诸如以下方式的作用 -
fun1 $input1 userInput1
并在调用该函数后,如果我echo $ userInput1它不打印任何东西。需要提及的是/ home/xyx/dest1路径是有效的。