Bash /
ParsingStringsSince Bash is a language built around strings, it is quite easy to handle them. One really neat thing is the ability to loop using the words in a variable. Like: Sentence="This is a bunch of words." for word in $Sentence ; do echo $word ; done -> This -> is -> a -> bunch -> of -> words. Getting a character out of a stringStrings are a series of characters. As such, if you know the position of the character(s) you want, you can use:
where You can get everything from a given position by not providing a length of selection:
Getting a word out of a stringIn order to get a specific word from a string variable, the echo $Sentence | cut -d ' ' -f 4 -> bunch where the |