The UNIX and Linux Forums  

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 -->
  #3 (permalink)  
Old 09-28-2006
Dhruva's Avatar
Dhruva Dhruva is offline
Registered User
  
 

Join Date: Mar 2006
Location: India
Posts: 255
{} is used for building strings.

Code:
FILE = 'basename $1'

the above line of code is taking first parameter passed to this script as argument.what basename command will do here is if you have given the filename with path like /abc/dir1/dir2/filename then the
Value of FILE that is $FILE will have value "filename".

Code:
BANK = 'dirname $1'

the above command will remove the filename and assign path of file to BANK.
BANK will be "/abc/dir1/dir2/"

Code:
INFILE = ${FILE}.${BANK}.$$

Now the INFILE will have value "filename./abc/dir1/dir2/.3456"
here $$ gives the process id. in unix each command will run as a process and generates id.and value of $$ may differ in each run.