[SOLVED] Reading two variables in a character string with "/" as field separator
SlackwareThis Forum is for the discussion of Slackware Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
most of these will fail if there are more than one '/' (eg /usr/share/xfce/xfwm4-theme-axe)
they all work admirably if you can guarantee only one.
Off the cuff, I'm not quite sure how to handle multiple ones - unless you just want the 'dirname' and 'basename' and are not worried about 'dirname' being a full pathname containing slashes ... or you could progressively use dirname until it return just a '.' ...
Off the cuff, I'm not quite sure how to handle multiple ones
Given the usage shown by kiki if there was more to it then it would be a path with the package last and the category second last. This is a simple one that can be dealt with by using reverse then cutting it after the second delimiter and reversing it again.
EDIT In the interests of insane bash scripts here is one of mine :