The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 09-28-2006
systemsb systemsb is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 23
See below ....

$vi a.sh
ab=$(pwd)
echo " "
echo "Current working directory is $ab"
FILE=$(basename $ab)
echo "FILE returns $FILE "
echo " "
ab=$(pwd)
echo "Current working directory is $ab"
BANK=$(dirname $ab)
echo "BANK returns $BANK"
echo " "

INFILE=${FILE}.${BANK}.$$
echo $INFILE


dam@athena:~$ ./a.sh

Current working directory is /home/dam
FILE returns dam

Current working directory is /home/dam
BANK returns /home

dam./home.11937




Not sure what you are trying to achieve...

I think what you probably wanted was

/home/dam.11937