0

I need little help on extracting string using csh. I have a variable containing a long string ending with _abc. I need to extract the whole string except _abc using csh. please help

CharlesB
  • 86,532
  • 28
  • 194
  • 218
XYZ_Linux
  • 3,247
  • 5
  • 31
  • 34

1 Answers1

1

You should have the command basename available, in which case you want

echo `basename mystring_abc _abc`
>> mystring
Andrew Marshall
  • 1,469
  • 13
  • 14