I'm using a script with a lot of SED commands, in conjunction with grep, cut, etc. I've come up against a wall with a particular road block:
I output a file from an SVN registry that gives me a list of files. The list consists of a variable number of lines that contain a path/file. The paths are not a consistent length, hence a variable number of /'s in them. I pipe this output to a file and manipulate that file to create a list of source files for a copy routine I'm writing.
I'd like to be able to read the path line(s) from this file and remove the file name itself thus replicating just the path that I can feed to an rcp command. But I've been hitting a wall as to how to detect the last slash in the line.
from
/u/dir1/dir2/dir3/file
/u/dir1/dir2/file
/u/dir1/file
to
/u/dir1/dir2/dir3/.
/u/dir1/dir2/.
/u/dir1/.
Or blank instead of periods.
I can show you my work / first tries if need be, but it resides in a lab that is cut off from public access, ie: the internet, so I'd have to retype it and thus, why I don't have my first examples here to look at.
Any sort of help would be appreciated, whether it be pointing me to another link (I've been searching this site for quite some time) I haven't found yet or what not.
Thanks folks! -Bruce