Fabrizio Morbini <[EMAIL PROTECTED]> [2002-11-27 08:21:25 +0100]:
> Hi, I have a question on the command "cut":
>
> -For example immagine that I want to select the filename from an absulute
> path (and the files hasn't all the same depth).
>
> How I can ask to cut to start to count the delimiter '/' from the end of
> the string instead of from the start?
I might suggest using awk instead. -F sets the delimiter. NF is the
number of fields on a line. NF-1 would be the second to the last
field on the line.
echo /one/two/three | awk -F/ '{print $(NF-1)}'
> There are other solution?
You are probably looking for basename. It was designed for just your
case.
basename /one/two/three
three
Bob
_______________________________________________
Bug-textutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-textutils