Bracket operator, example (1)

Given: a variable that contains the name of file (e.g. from keyboard input) :

fileName="data.col"

Aim: a program that prints just the basename of the filename:

data