Variable longpath="/dir1/dir2/dir3/filename.stuff.morestuff.garbage"
I want to end up with just "filename.extra.moreextra". So, I want to get rid of the path and .garbage
I want to do this with just ksh internals. So, no sed,grep,awk,expr, etc...
I can do it with two operations.
TYVM rdcwayx and drl.
I guess if I was going to use it enough and I am really 'lana' about using ksh internals, I could just write a function like this.
I think you're doing the right thing by gravitating towards ksh internal commands. This can really speed up your script by avoiding external processes. But you should not worry about using extra lines of code to accomplish this. It is still much faster than the overhead of forking another process. And rememeber that ksh compiles as it runs just like perl. If those two statements are in a loop, they will be read once... not once per iteration.