Crmgo Blog

bash

← Blog / Programming

bash

Posts: 22

Working with strings in bash

Working with strings in bash

· bash

Extracting a substring ${string:position} — from position to the end ${string:position:length} — from position, length characters long ${string: -length} — the last length characters Removing part of a string ${string#substring} — up to the first occurrence from the beginning ${string##substring} — up to the last occurrence from the beginning ${string%substring} — up to the first occurrence from the end…