Getting Range of Words from Arg List
I need to grab the name of a city from an argument list. The argument list can be several words long and would look something like this:
Code:
Cheery Creek Dam 2.7 ESE, CO This is what I have so far: Code:
#!/bin/bash Code:
Cheery Creek Dam 2.7 ESE, CO -- Tony |
This seems to work:
Code:
CITY=`echo $* | grep -E -o '(\b[A-Za-z]+\b.)+' | head -n 1` |
Wow ... Thanks for the quick reply! And it does work for me :-)
|
You're welcome.
|
All times are GMT -5. The time now is 11:55 PM. |