Reputation: 25
Suppose that I am in a folder ~/top
.
There is a file path like this: ~/top/middle/bottom folder
.
I want to define a local macro and then use it in the file path.
What I have done is the following:
local target ""bottom folder""
cd "middle"
cd `target'
This works fine but I can't figure out how to combine lines two and three into a single line.
I have tried cd "middle/`target'"
andcd ""middle/"+`target'"
but these are wrong.
Upvotes: 0
Views: 1369
Reputation:
Assuming you are already in the directory top
, the following should work:
local target bottom folder
cd "middle/`target'"
Upvotes: 2