I want to get a string between two special characters. For example,
/home/oracle/ggs/text.ext
I want oracle/ggs in the above string.
How can I do this using bash?
That returns the part after Other possible approaches that will fulfil your requirements:
|
|||||
|
For this particular example, you can use
The same in Perl:
|
|||||||||||||
|
Bash
|
|||
|
echo oracle/ggs
will answer your question. Please clarify what the requirement are. Is that characters 7 to 16? From the 2nd to 4th/
? – Stéphane Chazelas Jun 11 '14 at 20:19