I'd like to create alias
to run a program. My alias is as follows: alias cc=g++ -Wall -Wextra $1 -o $1
. This way I could write cc app.cpp
and the command would be g++ -Wall -Wextra app.cpp -o app.exe
However, there is a problem.
$1
give filename with extension but I need only filename. Is there a workaround? doskey
and ConEmu
don't have a variable for a filename without extension. Such a variable has for example for
in cmd.exe
. It is %A
.