{"id":27221165,"url":"https://github.com/diejel/shell_topics","last_synced_at":"2026-04-27T11:32:02.514Z","repository":{"id":287112040,"uuid":"963641841","full_name":"diejel/Shell_Topics","owner":"diejel","description":"Hands-on practice in my favorite language Bash","archived":false,"fork":false,"pushed_at":"2025-04-10T02:02:01.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T02:53:01.734Z","etag":null,"topics":["bash","hands-on","linux","shell","shell-script","unix","unix-shell"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diejel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-10T01:56:04.000Z","updated_at":"2025-04-10T02:03:23.000Z","dependencies_parsed_at":"2025-04-10T02:53:06.223Z","dependency_job_id":"60b76ce1-4cb6-4b97-b28f-32da4cc3034d","html_url":"https://github.com/diejel/Shell_Topics","commit_stats":null,"previous_names":["diejel/shell_topics"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diejel%2FShell_Topics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diejel%2FShell_Topics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diejel%2FShell_Topics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diejel%2FShell_Topics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diejel","download_url":"https://codeload.github.com/diejel/Shell_Topics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248173829,"owners_count":21059594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","hands-on","linux","shell","shell-script","unix","unix-shell"],"created_at":"2025-04-10T07:19:07.750Z","updated_at":"2026-04-27T11:32:02.464Z","avatar_url":"https://github.com/diejel.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 1. Parameter Expansion\n\nBash parameter expansion provides powerful ways to manipulate variables, extract substrings, apply conditional defaults, and more — all without invoking external commands. This makes scripts faster and more readable.\n\n- [1. Parameter Expansion](#1-parameter-expansion)\n    - [1.0.1. Expansion Types](#101-expansion-types)\n      - [1.0.1.1. Basic Usage:](#1011-basic-usage)\n      - [1.0.1.2. Default Value:](#1012-default-value)\n      - [1.0.1.3. Set Default:](#1013-set-default)\n      - [1.0.1.4. Error if Unset:](#1014-error-if-unset)\n      - [1.0.1.5. Check if Non-Empty](#1015-check-if-non-empty)\n      - [1.0.1.6. String Length](#1016-string-length)\n      - [1.0.1.7. Substring Extraction](#1017-substring-extraction)\n      - [1.0.1.8. Remove Prefix](#1018-remove-prefix)\n      - [1.0.1.9. Remove Long Prefix](#1019-remove-long-prefix)\n      - [1.0.1.10. Remove Suffix](#10110-remove-suffix)\n      - [1.0.1.11. Remove Long Suffix](#10111-remove-long-suffix)\n      - [1.0.1.12. Replace First Match](#10112-replace-first-match)\n      - [1.0.1.13. Replace All Matches](#10113-replace-all-matches)\n      - [1.0.1.14. Uppercase First Char](#10114-uppercase-first-char)\n      - [1.0.1.15. Uppercase All Chars](#10115-uppercase-all-chars)\n      - [1.0.1.16. Lowercase First Char](#10116-lowercase-first-char)\n      - [1.0.1.17. Lowercase All Chars](#10117-lowercase-all-chars)\n      - [1.0.1.18. Toggle Case](#10118-toggle-case)\n      - [1.0.1.19. Toggle all cases](#10119-toggle-all-cases)\n      - [1.0.1.20. Array slicing and substrings](#10120-array-slicing-and-substrings)\n      - [1.0.1.21. String slicing with negative offsets](#10121-string-slicing-with-negative-offsets)\n      - [1.0.1.22. String slicing with negative offset and length](#10122-string-slicing-with-negative-offset-and-length)\n      - [1.0.1.23. Parameter transformation `${parameter@operator}`](#10123-parameter-transformation-parameteroperator)\n\n\n### 1.0.1. Expansion Types\n\n\n#### 1.0.1.1. Basic Usage:\n\n| Syntax   | What it does?           | Example and Output                                                                                           |\n| -------- | ----------------------- | ------------------------------------------------------------------------------------------------------------ |\n| `${var}` | Gets the value of `var` | \u003cpre\u003edzuniga@vm_aws#~ name=\"Diego\" \u003cbr\u003edzuniga@vm_aws#~ echo \"${name}\" \u003cbr\u003edzuniga@vm_aws#~ Diego \u003cbr\u003e\u003c/pre\u003e |\n|          |                         |                                                                                                              |\n\n#### 1.0.1.2. Default Value:\n\n| Syntax            | What it does?                                        | Example and Output                                                                                                                                                            |\n| ----------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `${var:-default}` | Uses `default` value if `var` is not set or is empty | \u003cpre\u003e\u003cbr\u003edzuniga@vm_aws#~ var=\" \" \u003cbr\u003edzuniga@vm_aws#~ echo \"${var:-'no_value'}\" \u003cbr\u003edzuniga@vm_aws#~ no_value \u003cbr\u003edzuniga@vm_aws#~ echo $var \u003cbr\u003edzuniga@vm_aws#~ \" \" \u003c/pre\u003e |\n\n#### 1.0.1.3. Set Default:\n\n| Syntax            | What it does?                                               | Example and Output                                                                                                                                                                   |\n| ----------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `${var:=default}` | Sets `var` to `default` if unset or empty (and returns it). | \u003cpre\u003e\u003cbr\u003edzuniga@vm_aws#~ var=\" \" \u003cbr\u003edzuniga@vm_aws#~ echo \"${var:='no_value'}\" \u003cbr\u003edzuniga@vm_aws#~ no_value \u003cbr\u003edzuniga@vm_aws#~ echo $var \u003cbr\u003edzuniga@vm_aws#~ \"no_value\" \u003c/pre\u003e |\n\n#### 1.0.1.4. Error if Unset:\n\n| Syntax          | What it does?                                 | Example and Output                                                                                                                                              |\n| --------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `${var:?Error}` | Exits with `Error` if `var` is unset or empty | \u003cpre\u003e\u003cbr\u003edzuniga@vm_aws#~ var=\" \" \u003cbr\u003edzuniga@vm_aws#~ echo \"${var:?'Value of var is not set'}\" \u003cbr\u003edzuniga@vm_aws#~ bash: var: Value of var is not set\" \u003c/pre\u003e |\n\n\n#### 1.0.1.5. Check if Non-Empty \n\n| Syntax          | What it does?                                        | Example and Output                                                                                                                                             |\n| --------------- | ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `${var:+value}` | Returns `value` only if `var` is *set and not empty* | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ var='regex'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{var:+'var_value'\\}\"\u003cbr\u003e'var_value'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{var\\}\"\u003cbr\u003eregex\u003cbr\u003e\u003c/pre\u003e |\n\n\n#### 1.0.1.6. String Length\n\n| Syntax    | What it does?                | Example and Output                                                                     |\n| --------- | ---------------------------- | -------------------------------------------------------------------------------------- |\n| `${#var}` | Returns  the length of `var` | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ var='regex'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{#var\\}\"\u003cbr\u003e5\u003c/pre\u003e |\n\n\n#### 1.0.1.7. Substring Extraction\n\n| Syntax                | What it does?                            | Example and Output                                                                                      |\n| --------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------- |\n| `${var:start:length}` | Extracts a substring from variable `var` | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ var='abcdefg1234567890'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{var:5:3\\}\"\u003cbr\u003efg1\u003c/pre\u003e |\n\n#### 1.0.1.8. Remove Prefix\n\n| Syntax           | What it does?                                      | Example and Output                                                                                                       |\n| ---------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |\n| `${var#pattern}` | Removes the shortest prefix matching the `pattern` | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ file='sosreport_caseid_103446.tar.gz'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{file#*.\\}\"\u003cbr\u003etar.gz\u003c/pre\u003e |\n\n#### 1.0.1.9. Remove Long Prefix\n\n| Syntax            | What it does?                                         | Example and Output                                                                                                    |\n| ----------------- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |\n| `${var##pattern}` | Removes the **longest** prefix matching the `pattern` | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ file='sosreport_caseid_103446.tar.gz'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{file##*.\\}\"\u003cbr\u003egz\u003c/pre\u003e |\n\n#### 1.0.1.10. Remove Suffix \n\n| Syntax           | What it does?                                          | Example and Output                                                                                                                            |\n| ---------------- | ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |\n| `${var%pattern}` | Removes the **shortest** suffix matching the `pattern` | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ file='sosreport_caseid_103446.tar.gz'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{file%*.\\}\"\u003cbr\u003esosreport_caseid_103446.tar\u003c/pre\u003e |\n\n#### 1.0.1.11. Remove Long Suffix\n\n| Syntax            | What it does?                                         | Example and Output                                                                                                                         |\n| ----------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n| `${var%%pattern}` | Removes the **longest** suffix matching the `pattern` | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ file='sosreport_caseid_103446.tar.gz'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{file%%*.\\}\"\u003cbr\u003esosreport_caseid_103446\u003c/pre\u003e |\n\n\n#### 1.0.1.12. Replace First Match\n\n| Syntax           | What it does?                                                       | Example and Output                                                                                                                                                             |\n| ---------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `${var/old/new}` | Replaces the **first** occurrence of `old` with the value of `new`. | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ favorite_distro='My favorite distro is Fedora'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{favorite_distro/Fedora/Ubuntu\\}\"\u003cbr\u003eMy favorite distro is Ubuntu \u003c/pre\u003e |\n\n\n#### 1.0.1.13. Replace All Matches\n\n| Syntax            | What it does?                                                  | Example and Output                                                                                                                                                                                                                                                                          |\n| ----------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `${var//old/new}` | Replaces **all** occurrences of `old` with the value of `new`. | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ fs_choosen='EXT4 is a filesystem widely used in Linux Systems. EXT4 not allows snapshots as BTRFS does. '\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{fs_choosen//EXT4/XFS\\}\"\u003cbr\u003eXFS is a filesystem widely used in Linux Systems. XFS not allows snapshots as BTRFS does\u003c/pre\u003e |\n\n#### 1.0.1.14. Uppercase First Char\n\n| Syntax    | What it does?                            | Example and Output                                                                                     |\n| --------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------ |\n| `${var^}` | Capitalizes the first character of `var` | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ status='shutdown'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{status^\\}\"\u003cbr\u003eShutdown\u003c/pre\u003e |\n\n#### 1.0.1.15. Uppercase All Chars\n\n| Syntax     | What it does?                                 | Example and Output                                                                                      |\n| ---------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------- |\n| `${var^^}` | Converts all characters in `var` to uppercase | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ status='shutdown'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{status^^\\}\"\u003cbr\u003eSHUTDOWN\u003c/pre\u003e |\n\n\n#### 1.0.1.16. Lowercase First Char\n\n| Syntax    | What it does?                            | Example and Output                                                                               |\n| --------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------ |\n| `${var,}` | Lowercases the first character of  `var` | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ string='Regex'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{string,\\}\"\u003cbr\u003eregex\u003c/pre\u003e |\n\n\n#### 1.0.1.17. Lowercase All Chars\n\n| Syntax     | What it does?                                 | Example and Output                                                                                                                                                                                                                                                             |\n| ---------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `${var,,}` | Converts all characters in `var` to lowercase | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ string='EXT4 is a filesystem widely used in Linux Systems. EXT4 not allows snapshots as BTRFS does.'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{string,,\\}\"\u003cbr\u003e'ext4 is a filesystem widely used in linux systems. ext4 not allows snapshots as btrfs does'\u003c/pre\u003e |\n\n#### 1.0.1.18. Toggle Case\n\n| Syntax    | What it does?                             | Example and Output                                                                                             |\n| --------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------- |\n| `${var~}` | Toggles the `case` of the first character | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ string='Shell script'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{string~\\}\"\u003cbr\u003eshell script\u003c/pre\u003e |\n\n\n#### 1.0.1.19. Toggle all cases\n\n| Syntax     | What it does?                        | Example and Output                                                                                              |\n| ---------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------- |\n| `${var~~}` | Toggles the `case` of all characters | \u003cpre\u003e\u003cbr\u003edzuniga@aws_vm#~ string='Shell script'\u003cbr\u003edzuniga@aws_vm#~ echo \"\\$\\{string~~\\}\"\u003cbr\u003esHELL SCRIPT\u003c/pre\u003e |\n\n#### 1.0.1.20. Array slicing and substrings\n\n| Syntax                     | What it does?                                                             | Example and Output                                                                                           |\n| -------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |\n| `${array[@]:start:length}` | Expands to `length` elements starting at position `start`                 | \u003cpre\u003edzuniga@aws_vm#~ arr=(a b c d e)\u003cbr\u003edzuniga@aws_vm#~ echo \"\\${arr[@]:1:3}\"\u003cbr\u003eb c d\u003c/pre\u003e               |\n| `${array[@]: -n}`          | Expands to the last `n` elements of the array (note the space before `-`) | \u003cpre\u003edzuniga@aws_vm#~ arr=(one two three four)\u003cbr\u003edzuniga@aws_vm#~ echo \"\\${arr[@]: -2}\"\u003cbr\u003ethree four\u003c/pre\u003e |\n| `${#array[@]}`             | Expands to the number of elements in the array                            | \u003cpre\u003edzuniga@aws_vm#~ arr=(x y z)\u003cbr\u003edzuniga@aws_vm#~ echo \"\\${#arr[@]}\"\u003cbr\u003e3\u003c/pre\u003e                          |\n| `${#array[index]}`         | Expands to the length (in characters) of a specific element in the array  | \u003cpre\u003edzuniga@aws_vm#~ arr=(abc def)\u003cbr\u003edzuniga@aws_vm#~ echo \"\\${#arr[1]}\"\u003cbr\u003e3\u003c/pre\u003e                        |\n| `${!array[@]}`             | Expands to the list of indices of the array                               | \u003cpre\u003edzuniga@aws_vm#~ arr=(a b c)\u003cbr\u003edzuniga@aws_vm#~ echo \"\\${!arr[@]}\"\u003cbr\u003e0 1 2\u003c/pre\u003e                      |\n| `${array[@]}`              | Expands to all the elements of the array                                  | \u003cpre\u003edzuniga@aws_vm#~ arr=(sun moon star)\u003cbr\u003edzuniga@aws_vm#~ echo \"\\${array[@]}\"\u003cbr\u003esun moon star\u003c/pre\u003e     |\n\n#### 1.0.1.21. String slicing with negative offsets\n\n| Syntax                 | What it does?                                                              | Example and Output                                                                          |\n| ---------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |\n| `${var:offset}`        | Extracts substring from `offset` to end                                    | \u003cpre\u003edzuniga@aws_vm#~ str=\"abcdef\"\u003cbr\u003edzuniga@aws_vm#~ echo \"\\${str:2}\"\u003cbr\u003ecdef\u003c/pre\u003e       |\n| `${var:offset:length}` | Extracts `length` characters from position `offset`                        | \u003cpre\u003edzuniga@aws_vm#~ str=\"abcdef\"\u003cbr\u003edzuniga@aws_vm#~ echo \"\\${str:1:3}\"\u003cbr\u003ebcd\u003c/pre\u003e      |\n| `${var: -n}`           | Extracts the last `n` characters from the string (space before `-` needed) | \u003cpre\u003edzuniga@aws_vm#~ str=\"networking\"\u003cbr\u003edzuniga@aws_vm#~ echo \"\\${str: -4}\"\u003cbr\u003eking\u003c/pre\u003e |\n\n\n#### 1.0.1.22. String slicing with negative offset and length\n\n| Syntax         | What it does?                                                              | Example and Output                                                                                         |\n| -------------- | -------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |\n| `${var: -N}`   | Extracts the last `N` characters from the string (space before `-` needed) | \u003cpre\u003edzuniga@aws_vm#~ str=\"abcdef\"\u003cbr\u003edzuniga@aws_vm#~ echo \"\\${str: -2}\"\u003cbr\u003eef\u003c/pre\u003e                      |\n| `${var: -N:M}` | Extracts `M` characters starting from `N`th-last position                  | \u003cpre\u003edzuniga@aws_vm#~ str=\"abcdef\"\u003cbr\u003edzuniga@aws_vm#~ echo \"\\${str: -3:2}\"\u003cbr\u003ede\u003c/pre\u003e                    |\n| `${var:X:-Y}`  | **Invalid** syntax — length can't be negative                              | \u003cpre\u003edzuniga@aws_vm#~ str=\"abcdef\"\u003cbr\u003edzuniga@aws_vm#~ echo \"\\${str:2:-1}\"\u003cbr\u003ebash: bad substitution\u003c/pre\u003e |\n\n\u003e Tip: Always insert a space before the negative offset to avoid bash interpreting it as an option. Negative `length` is **not supported** and will cause an error.\n\n#### 1.0.1.23. Parameter transformation `${parameter@operator}`\n\n| Syntax     | What it does?                                                                                              | Example and Output                                                                                                                                                                                                              |\n| ---------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `${var@U}` | Converts **all characters** in the value of `var` to **uppercase**                                         | \u003cpre\u003edzuniga@aws_vm#~ var='bash power'\u003cbr\u003edzuniga@aws_vm#~ echo \\${var@U}\u003cbr\u003eBASH POWER\u003c/pre\u003e                                                                                                                                   |\n| `${var@u}` | Converts **only the first character** of `var` to uppercase                                                | \u003cpre\u003edzuniga@aws_vm#~ var='bash'\u003cbr\u003edzuniga@aws_vm#~ echo \\${var@u}\u003cbr\u003eBash\u003c/pre\u003e                                                                                                                                               |\n| `${var@L}` | Converts **all characters** in the value of `var` to **lowercase**                                         | \u003cpre\u003edzuniga@aws_vm#~ var='BASH Power'\u003cbr\u003edzuniga@aws_vm#~ echo \\${var@L}\u003cbr\u003ebash power\u003c/pre\u003e                                                                                                                                   |\n| `${var@Q}` | Prints the value in a **quoted form** that can be reused in Bash input                                     | \u003cpre\u003edzuniga@aws_vm#~ var='my \"var\" value'\u003cbr\u003edzuniga@aws_vm#~ echo \\${var@Q}\u003cbr\u003e'my var value'\u003c/pre\u003e                                                                                                                           |\n| `${var@E}` | Expands **backslash-escaped sequences** (like `\\n`, `\\t`) into their **literal characters**, like `$'...'` | \u003cpre\u003edzuniga@aws_vm#~ msg='Rumi Phrase:\\t\\n The Quieter You Become,\\n The More You Are Able To Hear\\n'\u003cbr\u003edzuniga@aws_vm#~echo \"\\${msg@E}\"\u003cbr\u003eRumi Phrase:\t\u003cbr\u003e The Quieter You Become,\u003cbr\u003e The More You Are Able To Hear\u003c/pre\u003e |\n| `${var@P}` | Interprets the value of `var` as a **prompt string** with escape sequences like `\\u`, `\\h`, `\\w`, etc.     | \u003cpre\u003edzuniga@aws_vm#~:/etc$ prompt='\\n[\\u@\\H \\d \\t]\\n[\\w]\\n\\\\$ '\u003cbr\u003edzuniga@aws_vm#~:/etc$ echo \"\\${prompt@P}\"\u003cbr\u003e[dzuniga@aws_vm dom abr 06 22:32:03]\u003cbr\u003e[/etc]\u003cbr\u003e$ \u003c/pre\u003e                                                    |\n| `${var@A}` | Expands as a `declare` **assignment string**, recreating the variable with type and value                  | \u003cpre\u003edzuniga@aws_vm#~ declare -A map=([k]=\"v\")\u003cbr\u003edzuniga@aws_vm#~ echo \\${map@A}\u003cbr\u003edeclare -A map=([k]=\"v\")\u003c/pre\u003e                                                                                                             |\n| `${var@a}` | Outputs variable **attributes as flags**, such as `a` (array), `i` (integer), etc.                         | \u003cpre\u003edzuniga@aws_vm#~ declare -i num=5\u003cbr\u003edzuniga@aws_vm#~ echo \\${num@a}\u003cbr\u003ei\u003c/pre\u003e                                                                                                                                            |\n\n\u003e  Notes:\n\u003e - Most transformations require **Bash 4.4+**.\n\u003e - For `@P`, expansions follow **PS1-style prompt escapes** and display shell-like formatted prompts.\n\u003e - `@a` reveals variable flags like `i` (integer), `a` (array), `x` (exported), etc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiejel%2Fshell_topics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiejel%2Fshell_topics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiejel%2Fshell_topics/lists"}