how to avoid -bash: command not found error

时间:2015-11-12 11:11:35

标签: linux bash shell ubuntu

Here is my script:

zio=build-mac-zio
x="zio"
y=${!x}

When I try echo $y, I get build-mac-zio as expected. However when I execute this command:

mkdir -p $JENKINS_URL/bkp/jobs/$y/builds/

I get the following message:

-bash: build-mac-zio: command not found

How can I access $y and use it to assign to other variables.

1 个答案:

答案 0 :(得分:0)

我对缺乏报价感到紧张。试试这个:

dirname=$JENKINS_URL/bkp/jobs/$y/builds/
od -c <<<"$dirname" 

你在那里看到任何意外的角色吗?