Skip to content

Commit

Permalink
make it more clean on () and {}
Browse files Browse the repository at this point in the history
  • Loading branch information
DininduSenanayake committed Jul 30, 2024
1 parent 45bb47f commit ef1ecdc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/04-redirection.md
Original file line number Diff line number Diff line change
Expand Up @@ -606,10 +606,10 @@ Inside our for loop, we create a new name variable. We call the basename functio

* * *

🙋 : In `name=$(basename ${filename} .fastq)`, Can I switch `{}` and `()` as in `name=${basename $(filename) .fastq}` ?
🙋 : **In `name=$(basename ${filename} .fastq)`, Can I switch `{}` and `()` as in `name=${basename $(filename) .fastq}` ?** 🚫

- **Order Matters:** You must use () for command substitution first, and within that, you can use {} for variable expansion as needed.
- **Contextual Importance:** Always use $(...) for command substitution and ${...} for variable expansion to ensure clarity and correctness in your scripts.
- **Order Matters:** You must use `()` for command substitution first, and within that, you can use `{}` for variable expansion as needed.
- **Contextual Importance:** Always use `$(...)` for command substitution and `${...}` for variable expansion to ensure clarity and correctness in your scripts.

In summary, while the two types of brackets serve different purposes, their correct order and usage are crucial for the intended functionality of your shell scripts.

Expand Down

0 comments on commit ef1ecdc

Please sign in to comment.