Skip to content

Improve arrays chapter #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2024
Merged

Improve arrays chapter #156

merged 1 commit into from
Aug 4, 2024

Conversation

bobbyiliev
Copy link
Owner

What type of PR is this? (check all applicable)

  • ♻️ Refactor
  • ✨ Feature
  • 🐛 Bug Fix
  • 👷 Optimization
  • 📝 Documentation Update
  • 🚩 Other

Description

Bug: Substring in Bash :: Slicing - Examples incorrect

Related Tickets & Documents

Fixes #153

Added to documentation?

  • 📜 readme
  • 🙅 no documentation needed

Copy link

what-the-diff bot commented Aug 2, 2024

PR Summary

  • Book Updated
    The book version has been updated from Oct 30, 2023 to Feb 8, 2024.

  • Bash Arrays: Examples & Explanations

    • Introduced the correct way to return all elements in the array instead of default arguments.
    • Added guidance on array slicing, indexing, and slicing strings for diverse range of results.
    • Enhanced examples of array element printing, both in regards to individual and range of elements.
    • Emphasized the importance of using [@] when referring to all array elements, alongside the benefits of enclosing parameter expansion in quotes to keep any spaces present within specific array elements.
  • Array Slicing: Expanded Information

    • Broadened scope on array slicing knowledge, detailing functionality in according with Bash 4.0 syntax, individual element accessing, and range of elements.
    • Elucidated how both array indexing and string slicing methods can be utilised to achieve array slicing-esque outcomes.
  • String Slicing: Theory and Practice

    • Expanded theoretical understanding of string slicing in Bash.
    • Revamped examples of extracting string portions using slicing.
    • Clarified the role of the second number in slice notation, explaining it defines the maximum extracted substring length instead of dictating the ending index.
    • Included practical examples of string sections extraction, detailing obtaining the available string characters when the desired count exceeds the string length.

@bobbyiliev bobbyiliev merged commit 5df218a into main Aug 4, 2024
1 check passed
@bobbyiliev bobbyiliev deleted the improve-arrays-chapter branch August 4, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Substring in Bash :: Slicing - Examples incorrect
1 participant