I have a folder structure that looks like this
/some/folder/1 /some/folder/2 ...
and a symlink
current that links to one of the folders. Is it possible and when how to read the target of the link, increment the name of the last folder and create a folder with that number, e.g. read the link that points to
/some/folder/2 so I know the last number is
2 and increment this number to create a new folder
/some/folder/3 to store new files?
I already have a script that reads the target of the link, but I have no clue how to get the last part of the path (the number) and increment it by one.