|
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
|