In my shell script, I've declared a variable 'result' which gives me output like this, ZLISTBGY|Guyana|D
Now, I have 3 more variables which work on the 'result' variable
argtbl=$(echo $result | cut -d"|" -f 1)
country=$(echo $result | cut -d"|" -f 2)
operation=$(echo $result | cut -d"|" -f 3)
So, the argtbl in the above example is "ZLISTBGY"
the country is "Guyana"
and, the operation is "D"
But when I get country names like "United Arab Emirates" or "American Samoa", basically the countries which are space separated, I do not get the desired value in the "result" variable
What I want is: ZLISTBAS|American Samoa|D
What I'm getting currently is: ZLISTBAS|American
I think the cut command for "country" variable considers the whitespaces in the country-names as delimeters/restrictions and doesn't proceed further
I have looked for solutions with awk/sed commands too, but none of them worked
I'd really appreciate if someone can help me with this.