2012-04-12

ZSH substr

One handy shortcut for getting all the characters except the first 2:

SHORTSTRING=$LONGSTRING[3,-1]

The negative offset is relative to the end of the string.

No comments:

Post a Comment