I need to find all the positions of a specific character ##
in a file using Bash script and also store all positions for future use.
This is how the file looks like:
assert property ( ( req1 == 0 ) ##1 ( req1 == 1 ) ##1 !( req2 == 1 ) || (gnt1 == 0 ) );
assert property ( ( req1 == 0 ) ##1 !( req1 == 1 ) || ( gnt1 == 1 ) );
assert property ( ( req1 == 1 && req2 == 0 ) ##1 !( req2 == 1 ) || ( gnt1 == 0 ) );
In the above file I want to get all locations for this character (##
) and store them as well. How can this be done using shell script?