bash: trim substring sample