Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone know what the following means in a shell script?

export VAR=${1:9:8}

Replies are listed 'Best First'.
Re: shell script query
by rovf (Priest) on May 31, 2011 at 08:25 UTC
    Sorry, mate, wrong forum. This is for Perl programming.

    By the way, if you ask in a forum about shell scripting, I strongly suggest that you also mention, which shell you are using.

    Having said this, your command syntax is likely bash or zsh or ksh, and probably taking a substring. If it is bash, grep the man page for the chapter "Parameter Expansion".
    -- 
    Ronald Fischer <ynnor@mm.st>
Re: shell script query
by ig (Vicar) on May 31, 2011 at 08:44 UTC

    If your shell is bash it is a sub-string of ${1}, at offset 9 and length 8, which you can find in bash - see Parameter Expansion.

      Also applies to Korn shell 93 (not 88).
Re: shell script query
by jimmy.tty (Scribe) on May 31, 2011 at 14:12 UTC
    equivalent to the "substring" in several programming languages; in perl, uses substr().