For some reason the terminal on my mac does not let me run string manipulations commands using the expr command. I'm not sure how to fix this so I'm requesting a "work-around" to using the expr command...
This is the string I'm working with:
"neo_opls01_1.log"
And I'm trying to find the index of the period (.) and extract the prefix. So the substring I want would be:
"neo_opls01_1"
Do you guys know how to do this without using the expr command? Or is there something I need to do to my mac to be able to use string manipulation commands with the expr command? Both suggestions would be really helpful!!
Well, not to be a wise guy, but did you happen to notice that the awk -F and the the cut -d argument pairs define a field delimiter, as did scottn's shell command? Figure your string seems to include one that you could use .
Try it out. Play a little. Let me know how it works.