variable_exp.ion 572 B

123456789101112131415161718192021
  1. echo '# ANCHOR: string_variables'
  2. let string = "example string"
  3. echo $string
  4. echo $string:$string
  5. echo '# ANCHOR_END: string_variables'
  6. echo '# ANCHOR: array_variables'
  7. let array = [one two three]
  8. echo @array
  9. echo '# ANCHOR_END: array_variables'
  10. echo '# ANCHOR: braced_variables'
  11. let hello = "hello123"
  12. echo ${hello}world
  13. let hello = [hello 123 ' ']
  14. echo @{hello}world
  15. echo '# ANCHOR_END: braced_variables'
  16. echo '# ANCHOR: aliases'
  17. alias ls = "ls --color"
  18. #echo $ls #ion: expansion error: Variable does not exist
  19. #aliase are stored separately
  20. echo '# ANCHOR_END: aliases'