using cut command

I am new to unix ... I have a file with name unixile.123761 I need to cut the extension from this file name? can u help me for this

i have tried like follows

copied the file lo one variable v

and then `echo $v | grep cut -d = -f 1`

#!/bin/ksh
a=unixile.123761
firstpart=${a%%.*}
extension=${a##*.}

firstpart is now unixile, extension is 123761

Hi jim,
could you please explain the command. I am new to Unix. I googled it and I could not find much information about curly braces.

Thanks,
Don

Those commands are used to split strings of characters into pieces.
You can also use cut, but it will have problems with a filename like mytarball.tar.gz

This page explains how to play with strings in bash (ksh has the same {} syntax for %, %%, #, and ##)
Manipulating Strings

The grep in your original post is surplus and will give syntax errors.
I think you meant:

v="unixile.123761"
w=`echo "$v" | cut -d\. -f1`
echo "$w"

unixile

v="unixile.123761"
firstpart=`echo "$v" | cut -d '.' -f1`
extpart=`echo "$v" | cut -d '.' -f2`

for a in `ls`; do if [ $a != ${a%.} ] ; then mv $a ${a%.}; fi; done

write this in the shell when you are positioned in the directory where you want to make the changes; note that the command {a%.*} is non-greedy - that is the file 'this.is.my.file' will be renamed 'this.is.my', not just 'this'

Or alternatively, you can use AWK too..

v="unixile.123761"
ext=`echo $v | awk -F "\." '{ print $2 }'`
echo $ext

In case, if you have file name like mytarball.tar.gz, this code snippet will print "tar".

for a in *