Back to cheatsheets
Shell
How to get current directory in Shell script?
You can use bash script with awk command and pwd.
pwd
|
awk
'{n=split($1,A,"/"); print A[n]}'