How does bash know where my variable names end?

Viewed 14167

Given:

myvar=Hello
  • echo $myvar -> Shows Hello (fine so far)
  • echo $myvar#world -> shows Hello#world (why? I thought it would complain that here is no such variable called myvar#world)
  • echo ${myvar#world} -> shows just Hello (again, why?)
2 Answers
Related