Directory:
/home/foo/bar bar/something
Code:
#!/bin/sh
UDIRX=`pwd`
BASENAME=$(basename $UDIRX)
echo
echo Object being worked on is $BASENAME.example
output: Object being worked on is bar.example
Code:
person@linux:~/bar bar/something$ basename `pwd`
bar
I don't want the output to be "bar."
How do I change the first script so that the output is something.example?
Is there a way I could have a script that works with directories that do and do not have a space?