Date: Fri, 16 Nov 2007 15:54:46 -0000 (GMT) From: jhall@vandaliamo.net To: "Giorgos Keramidas" <keramida@ceid.upatras.gr> Cc: jhall@vandaliamo.net, freebsd-questions@freebsd.org Subject: Re: bash and strings Message-ID: <49329.65.117.48.155.1195228486.squirrel@admintool.trueband.net> In-Reply-To: <20071116133339.GA2312@kobe.laptop> References: <52275.12.170.206.13.1195184604.squirrel@admintool.trueband.net> <20071116133339.GA2312@kobe.laptop>
next in thread | previous in thread | raw e-mail | index | archive | help
>
> See the `dirname' and `basename' commands:
>
> $ dirname "/usr/local/scripts/firewall.sh"
> /usr/local/scripts
> $
>
> $ basename "/usr/local/scripts/firewall.sh"
> firewall.sh
> $
>
> Be careful about properly quoting the filenames though (note how the
> first invocation of `dirname' fails below, and try to understand why
> it fails):
>
> $ testname='foo bar baz'
> $ dirname $testname
> usage: dirname string
> $ dirname "${testname}"
> .
> $
>
>
Thank you very much this is exactly what I was looking for.
Jay
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49329.65.117.48.155.1195228486.squirrel>
