0

I have a string like:

arn:aws:ecs:us-east-1:123456789:task-definition/myservice:10

Is there anyway I can get the last value 10? I tried to get last character but forgot that this int value can increase and eventually becomes 2 characters.

Casper
  • 1,663
  • 7
  • 35
  • 62

1 Answers1

0

Well, many ways, this one works, though is not elegant :)

echo "arn:aws:ecs:us-east-1:123456789:task-definition/myservice:10" | sed 's/.*://'

Cynichniy Bandera
  • 5,991
  • 2
  • 29
  • 33