The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 08-20-2007
anchal_khare anchal_khare is offline
Registered User
 

Join Date: Jun 2007
Location: Mumbai,India
Posts: 99
the cat command itself displays the content of the file...
"cat test" will display the file content of test. and using pipe u are redirecting the contents to the next command ( mail in ur case).

for usage of $ follow the same rule as namishtiwari told.

so just for example and considering ur case
u define a variable like this
file_path=/clocal/mqbrkrs/user/mqsiadm/sanjay/temp

so in ur test command u need to use the value of the variable file_path which is the actual path of ur file. so u have to use "$file_path"

so ur command 'll be like this
if [ -s "$file_path" ]


its always a good idea of using variables instead of hardcoding the paths.
for both security as well as reusing of the code.


anchal
Reply With Quote