Tag Archive for 'variables'

Shell-script: substrings

  • english
  • spanish

You can work with substrings in bash using the following syntax:

${VARIABLE:START:LENGTH}

Like in:

$ A=abcdefghi $ echo ${A:3:2} de



Creative Commons Attribution-NonCommercial 2.5 Spain
Creative Commons Attribution-NonCommercial 2.5 Spain