5 Minute Lessons in Shell Script Programming: Extraction Operators

Published: 08 January 2021
on channel: Dana French
44
1

This is a short 5 minute lesson about "extraction" operators in shell scripting. These operators allow the programmer to extract pieces and portions of a value contained in a shell variable, environment variable, or indexed array variable.

${VARIABLE:OFFSET} Extract a substring from VARIABLE value beginning at OFFSET

${VARIABLE:OFFSET:LENGTH} Extract a substring from VARIABLE value beginning at OFFSET with a specifid LENGTH

${ARRAY[*]:OFFSET}
${ARRAY[@]:OFFSET} Extract a subset of ARRAY elements beginning at index OFFSET

${ARRAY[*]:OFFSET:LENGTH}
${ARRAY[@]:OFFSET:LENGTH} Extract a subset of ARRAY elements beginning at index OFFSET including LENGTH number of elements


On this page of the site you can watch the video online 5 Minute Lessons in Shell Script Programming: Extraction Operators with a duration of hours minute second in good quality, which was uploaded by the user Dana French 08 January 2021, share the link with friends and acquaintances, this video has already been watched 44 times on youtube and it was liked by 1 viewers. Enjoy your viewing!