I am trying to modify my CMD, to show only the current directory name dynamically, like:
Desktop $
When I switch the folder, it must be updated.
It is not required to be code in a pure batch file. It may depend on any external commands, Cygwin Bash, etc.
@echo off
set a=bash -c "pwd | sed 's,^\(.*/\)\?\([^/]*\),\2,'"
%a%
cmd
Outputs
_test-et
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. Tüm hakları saklıdır.
>>
But
>> prompt %a%
gives
bash -c "pwd | sed 's,^\(.*/\)\?\([^/]*\),\2,'"