Suppose I have an array where each element in the array is in the following format:
someText (x1,y1,z1) (x2,y2,z2) (x3,y2,z3) KEY
What is the a
This is how you can get first and last element of your string in the array:
echo "someText (x1,y1,z1) (x2,y2,z2) (x3,y2,z3) KEY" | rev | cut -d " " -f 1 | rev echo "someText (x1,y1,z1) (x2,y2,z2) (x3,y2,z3) KEY" | cut -d " " -f 1