I want to create an alias that will print out the current working directory sub name.
I have this:
BASENAME=${PWD##*/}
alias wai="echo $BASENAME"
This outputs the directory subname of the directory .bashrc is stored in. I want it to be the current working directory.
Sorry if this is simple, I'm new to bash.
The trick is really just in the single quotes. I believe you can achieve this by doing the following:
'echo ${PWD##*/}'
More details: Difference between single and double quotes in Bash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With