1: 2: 3: 4: 5: 6: 7: 8:
#!/bin/bash var='Line 1: This is a line' if echo $var | grep -q : then var1=${var%%:*} var2=${var#*:} fi