> Hello all!
> This should be really simple, but for some reason the solution evades me.
> Consider this:
> #!/bin/bash
> my_var = '/home/nikita/foo.txt'
> echo $my_var
> This will print
> /home/nikita/foo.txt, of course.
No, you'll get an error message:
bash: my_var: command not found
Quote:> I want it to print just "foo.txt"--I want
> to strip out the pathname info. How do I do it in BASH?
my_var=/home/nikita/foo.txt
echo ${my_var##*/}
--
Chris F.A. Johnson http://cfaj.freeshell.org
===================================================================
My code (if any) in this post is copyright 2003, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License