Choose your weapon of choice:
localhost>expr substr "123456" 1 3
123
localhost>echo "123456" | cut -c1-3
123
localhost>echo "123456" | awk '{print substr($0, 1, 3)}'
123
Choose your weapon of choice:
localhost>expr substr "123456" 1 3
123
localhost>echo "123456" | cut -c1-3
123
localhost>echo "123456" | awk '{print substr($0, 1, 3)}'
123
Nothing to see here, move along…