I'm working on a script. I'm trying to print out a path that look somewhat like this: /example/example/file. If what I'm checking starts with  /  i do not print out the path I have in a variable that looks somewhat like this path=/example/example. But if it does not start with a  /  I add the path. What I want to to is that I want to remove the path in-front of the file.If it starts like this:/example/example/file.exampleI want it to look like thisfile.exampleHow can I do this in a if statement?
Remove infront of word with if
linux;bash;scripting