.sh and sed

Randy Belk randy.belk at gmail.com
Wed Jun 16 13:55:40 UTC 2010


You could always use basename for this. "basename /usr/local/bin/bash"
will display "bash"

On Wed, Jun 16, 2010 at 6:16 AM, Aiza <aiza21 at comclark.com> wrote:
> Trying to use sed to remove the path from the file name.
> Variable has complete path plus the file name
> /usr/local/etc/filename
> Need variable containing only the file name.
> Is the sed utility the best thing to use?
> Is there some other utility better suited for this task.
> How would sed by coded to do this?
>
> Thanks for your help in advance.
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>



-- 
- Simplicity is the ultimate sophistication. - Leonardo da Vinci
- Intelligence is not defined by what you know, It's how you USE it.
- People who hate Windows use Linux but people who love UNIX use BSD.


More information about the freebsd-questions mailing list