Quantcast
Channel: Take Command / TCC
Viewing all articles
Browse latest Browse all 1793

Issue with CD_LEAVE Alias

$
0
0
I don't understand what is happening here.

TCC(27.01.23): C:\>alias cd_leave
echo `%1=`%1 & set oldcwd=%1 & echo oldcwd=%oldcwd

TCC(27.01.23): C:\>cd temp
%1=C:\
oldcwd=C:\ C:\temp

TCC(27.01.23): C:\temp>

It is acting as though I had written "set oldcwd=%1 %2" as the middle command of the three. If I change the alias to

echo `%1=`%1, `%2=`%2 & set oldcwd=%1 & echo oldcwd=%oldcwd

then things work.

TCC(27.01.23): C:\>alias cd_leave
echo `%1=`%1...

Read more

Viewing all articles
Browse latest Browse all 1793