Bash substrings

Say you have lines in a file that are of the format:

123:200105

and you need to split out the strings to work with them.

string=123:201004
string2=${string:0:3} # result is 123
string3=${string:4:6} # result is 201004

Comments

Popular posts from this blog

rsync to SD card recopying files

OS X right side of menu bar frozen

Changing the email address on your Nike + iPod acount