July 2018
Beginner
264 pages
8h 9m
English
After running the two scripts in this recipe, we can see a few items emerge (especially if we compare the built-in Bash functionality for searching, replacing, and substrings).
$ bash ./some-strs.sh First character 1First three characters 123Third character onwards 4567890asdfghjklForth to sixth character 456Last character by itself lRemove last character only 1234567890asdfghjk
At this point, we have seen the echo command used several times, but the -n flag means that we should not automatically create a new line (or carriage return). The <<< re-direct for inputting values as a string has also been previously used, so this should not be new information. ...
Read now
Unlock full access