-1

I have a line like below:

/home/user/pigscripts/abc.pig

Can anybody help me in writing a shell script or unix command.

I want to get only abc from above line. the out put should give me only
abc

Amaresh
  • 3,231
  • 7
  • 37
  • 60

1 Answers1

-1
$ python -c "import os; base, ext = os.path.splitext(os.path.basename('/home/user/pigscripts/abc.pig')); print base"
pig
Mike Graham
  • 73,987
  • 14
  • 101
  • 130