How to parse out the end of a path in a unix shell script? How to parse out the end of a path in a unix shell script? shell shell

How to parse out the end of a path in a unix shell script?


I think you are looking for the basename command.

$ basename /home/test/user1user1

Edit: (in response to your comment)

In a shell-script variable, you need backticks:

END_OF_PATH=`basename "${1}"`