#!/usr/bin/env bash line="ada:1815:london" # -d sets the delimiter, -f picks fields (1-indexed) echo "$line" | cut -d: -f1 echo "$line" | cut -d: -f2,3
cut selects columns by delimiter