How split the input path into components



Hi All!

I have a simple problem. but its urgent.

I have a variable in shell. say
$PATH'='/p2k/c9.1/IRB/shell/data";

I need to cut this string with dilimeter 'IRB'. So I want the result
as

$str1 ='/p2k/c9.1/IRB/' or '/p2k/c9.1/IRB'
$str2='shell/data' or '/shell/data'

if $str1= '/p2k/c9.1/' also OK for me.

I tried in this way;
echo "p2k/c9.1/IRB/shell/data"|{ IFS="IRB" read a b c; echo $c;}
but I got 'B/shell/data' I don't why 'B' came?

Please help me ASSAP.

.



Relevant Pages

  • Memorial Day report
    ... the pieces I'd fused with my bare match used a double string (parallel ... My film cannister shell was a test of my first use of homemade piped ... One of the stars distinctly changed from ... I get a good fire seal and fit to the mortar without noticeably ...
    (rec.pyrotechnics)
  • Re: Off center spiking
    ... 32 - The procedure is the same for any diameter shell. ... strands of cotton, laying flat next to each other both vertically ... pick a guide mark on top and wind to the bottom matching ... shell from what appear to be two separate strands of string. ...
    (rec.pyrotechnics)
  • Re: Off center spiking
    ... Your video is worth 1000 times that. ... 32 - The procedure is the same for any diameter shell. ... strands of cotton, laying flat next to each other both vertically ... shell from what appear to be two separate strands of string. ...
    (rec.pyrotechnics)
  • comp.unix.shell FAQ - Answers to Frequently Asked Questions
    ... This FAQ list contains the answers to some Frequently Asked Questions ... It spells "unix" in lower case letters ... The other level is how to write shell scripts. ... if the string being echoed wasn't built into the script ...
    (comp.unix.shell)
  • comp.unix.shell FAQ - Answers to Frequently Asked Questions
    ... This FAQ list contains the answers to some Frequently Asked Questions ... It spells "unix" in lower case letters ... The other level is how to write shell scripts. ... if the string being echoed wasn't built into the script ...
    (comp.unix.shell)