08-21-2007
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
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
PATH="/clocal/mqbrkrs/user/mqsiadm/sanjay"
MAIL_RECIPIENTS="xyz@abc.com"
Subject="File accessed in last minutes:"
find $PATH -type f -amin -1 > temp.txt.$$
cat temp.txt.$$ | \
while read line
do
fuser -uV $line >> tempmail.txt
done
cat "$tempmail.txt" | mailx -s "$Subject"... (4 Replies)
Discussion started by: varungupta
4 Replies
2. Shell Programming and Scripting
#! /bin/bash
head -5 $1
echo "remove $1 ?"
read answer
if
then
echo invalid answer
elif
rm $1
echo "$1 is deleted"
elif
then
echo file is not deleted
else
echo "invalid answer"
fi
What i really want this to do is to ask to delete the file or not..it says something wrong... (1 Reply)
Discussion started by: nadman123
1 Replies
3. Shell Programming and Scripting
#! /bin/bash
USAGE=" | ]
if
then
echo "$USAGE"
exit 1
fi
while getopts lb: OPTION
do
case $(OPTION)in
a) echo Hi there!
exit 2;;
b) echo hello
o) OARG=$OPTARG;;
\?)echo "$USAGE" ;;
exit 2;;
esac
done
shift `expr... (1 Reply)
Discussion started by: nadman123
1 Replies
4. Shell Programming and Scripting
ls -ld | grep $1 /etc/passwd | cut -d: -f6
i need see the content... (4 Replies)
Discussion started by: nadman123
4 Replies
5. Shell Programming and Scripting
I have four variables, dumpdata, defndata, compare1 and compare2
I want an IF statement condition which returns true when either dumpdata=defndata or (dumpdata<=compare1 and dumpdata>=compare2).
But this is not working for me..
if (4 Replies)
Discussion started by: indianjassi
4 Replies
6. UNIX for Dummies Questions & Answers
can anyone tell me why this code doesn't work how its supposed to, its the hangman game but it doesn't play how its supposed to
#!/bin/bash
NoAttempts="0"
livesgiven="5"
LivesRemain=$livesgiven
LettersAttempted=""
wordfile=words
numwords=0
function menu()
{
clear
cat << menu... (1 Reply)
Discussion started by: ferrycorsten73
1 Replies
7. Shell Programming and Scripting
I am trying to find a value within a properties file and declare it into a variable. Script below. I want the "memSize" to be the branch from the properties file. Right now it always tells me "Not found" What am I doing wrong?
#!/bin/sh
memsize ='';
memSize=`sed '/^\#/d'... (8 Replies)
Discussion started by: vsekvsek
8 Replies
8. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
ls -ld htdocs
drwxr-x--- 3 root root 8192 2006-11-19 10:41 htdocs
How would a host administrator... (1 Reply)
Discussion started by: Larry_1
1 Replies
9. UNIX for Dummies Questions & Answers
hi whats wrong in below??
CHECK=M10;
if ;
then
echo "hello hi";
else
echo "how are u hello hi";
fi
I am getting error as
./test.sh: line 2: '
./test.sh: line 2: M10: command not found
./test.sh: line 2: M10: command not found
./test.sh: line 2: M10: command not found (8 Replies)
Discussion started by: skyineyes
8 Replies
10. UNIX for Dummies Questions & Answers
whats wrong with the syntax, just the if-else part? Struggling for a bit with this now..I`m simply trying to increment 3 variables based on missing data, matches or mismatches for i and j
.......
{for(i=1;i<=NF;i++)
for(j=i+1;j<=NF;j++)
{ if(i=="" || $j=="") m++
... (1 Reply)
Discussion started by: senhia83
1 Replies
VITE(1) ViTE Manual Pages VITE(1)
..___________..._
__vXXX=========onn=XX=X=s_..
_a=X=============v:|||||i:lvvn=Xn_,
"!XX===========v||||||||||||iiiv=Xn_
-"!XX======v||||||||||||iii:::vn=Xs
""!!!Zl|||||||||||iii::lIlvvnXX,.
Jl||||||||||i:vvvvlIvvvvv=Zc
_e|||||||||ia}"""""!=anvnvnnXno=========aa_.
]l||||||||v}' "Xnnnnnn=o=====XXXX=adZ=__
=||||||||n( .3nnnon=======X=Xs..___X|%!n_,
)1||||||i;^ 3=noo=======X=XXXZ1v|i|||||iIs,
X||||||a! 3=n========X=X=X=Ii||||||||||iIs,
.Jl|||va! .==o=o=====X=XXX=li|||||||||||||i3..
)na:!"` =========X=XX=1:|||||||||||||||||)a
.. .========X=XXIIi||||||||||||||||||v}
X=====X=X=1l|i|||||||||||||<a>}""^
.X===X==1Ii||||||||||||<a>""`:
+X=nI:i|||:llv_asl}"""`
-ni||<c"^.
-1%<e.
!3`
NAME
vite - a visual trace explorer
SYNOPSIS
vite
vite -h
vite [-f|-a] file_path [-e export_path] [-t [time_init]:[time_end]]
DESCRIPTION
ViTE is a visual trace explorer. It is a useful tool for profiling and debugging parallel programs (multi-process or multi-core).
ViTE reads program execution trace data from file (currently in Paje trace format) and display it in a graphical interface. Program execu-
tion data could be a state (drawn as a colored rectangle - color depends of the kind of state), an event (drawn as a green disc) or a com-
munication between two processes (drawn as a white arrow).
OPTIONS
ViTE accepts the following options:
-h Display help.
-f file_path
Open the file_path file.
-a file_path
Open the file_path file and display it entirely.
-e export_path
Export the opened trace file (with -f or -a option) to the export_path file in SVG format.
-t [time_init]:[time_end]
Just parse trace from time_init to time_end.
If time_init is missed, trace will be parsed from the minimum time to time_end.
If time_end is missed, trace will be parsed from time_init to the maximum time.
AUTHORS
ViTE was created by a group of french engineering school students for the INRIA research center.
REPORTING BUGS
Report bugs to ViTE developers <vite-developpeurs@lists.gforge.inria.fr>.
COPYRIGHT
ViTE was released under the CeCILL-A licence. The content can be found here: http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt.
Copyright (C) 2009 Kevin COULOMB
Copyright (C) 2009 Johnny JAZEIX
Copyright (C) 2009 Olivier LAGRASSE
Copyright (C) 2009 Jule MARCOUEILLE
Copyright (C) 2009 Pascal NOISETTE
Copyright (C) 2009 Arthur REDONDY
Copyright (C) 2009 Clement VUCHENER
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Version 1.2 April 2009 VITE(1)