var_bash1.tests 227 B

123456789101112131415161718
  1. var=abcdef
  2. echo ${var:7}
  3. echo ${var:6}
  4. echo ${var:5}
  5. echo ${var:1}
  6. echo ${var:0}
  7. echo ${var:-1}
  8. echo ${var:1:4}
  9. echo ${var:0:4}
  10. echo ${var::4}
  11. echo ${var:-1:4}
  12. echo ${var:1:7}
  13. echo ${var:0:7}
  14. echo ${var::7}
  15. echo ${var:-1:7}