Help Shell Script

hi hi!!!

please help me on this one.

i want to check if a file called Primes.class is of .class format

wat is the syntax???

my present situation is that i pass this Primes.class into a variable. but i juz cant compare if its of the .class file format...

i am using .ksh to code my scripts
Please help me asap thanky :smiley:

To see what kind of file somthing is:

file <filename>

for example:

file /etc/resolv.conf

will return this:

/etc/resolv.conf: ASCII text

for "class" files you might see this

file RAPlayer.class
RAPlayer.class: compiled Java class data, version 45.3

let me know if this helps!!

RECON

actually i need is a if statement to check if its of a .class format...
hehehehe
it didnt help much but i appreciate it!
thanx recon! hehe:D

you probably want to set a variable to the output of the previous command:

filetype=`file /etc/resolv.conf`

and then perform a test on the variable filetype to see if tit contains what your looking for

let me know if this helps you.