> Also, if you want to make this portable so it works on other shells > than just bash, you can do something like this to get the port number: > > echo $a | cut -f4- -d"'" | rev | cut -c 5- | rev > > There are probably other ways to do it using sed, etc.
Here is a sed equivalent, which might be a more conventional approach: $ echo $a <cmd='send_data' msg='12345' '> $ echo $a | sed "s/^.*msg=[']\([^']*\)['].*$/\1/" 12345 -Alex _______________________________________________ Dillo-dev mailing list -- dillo-dev@mailman3.com To unsubscribe send an email to dillo-dev-le...@mailman3.com