Bash: Split a variable after the first occurence of an alphabetical character

Published: 8/11/2019
Bash: Split a variable after the first occurence of an alphabetical character
Source: UNIX.STACKEXCHANGE.COM

I have a variable which contains a line from a crontab eg: 0 22 * * 1-5 echo hello I want to split this into 2 variables, one with the numbers or asterisks denoting the periodicity of the job, and one with the command to be executed when the job runs. So i need to find a way to split the string the first time an alphabetic character occurs, but i have no idea how to do this.

Read more
Related news
Comment
FACEBOOK