Bash String Functions Substring Method Sql