bash_notes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
bash_notes [2022/02/23 22:10] – [stackoverflow links I came across] raju | bash_notes [2023/12/28 08:46] – [useful links] raju | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== tasks ===== | ||
+ | ==== dummy ==== | ||
+ | * [[list files within a specific range]] | ||
+ | |||
===== dummy ===== | ===== dummy ===== | ||
+ | ==== other pages in this wiki ==== | ||
+ | * [[bash scripting]] | ||
+ | |||
==== useful links ==== | ==== useful links ==== | ||
- | * https:// | + | |
+ | | ||
+ | * https:// | ||
+ | * http:// | ||
+ | |||
+ | ==== documentation links ==== | ||
+ | * ignoredups, erasedups - https:// | ||
+ | |||
+ | ==== what is the difference between "ls > dirlist 2>& | ||
+ | The command | ||
+ | < | ||
+ | ls > dirlist 2>& | ||
+ | </ | ||
+ | directs both standard output (file descriptor 1) and standard error (file descriptor 2) to the file dirlist, while the command | ||
+ | < | ||
+ | ls 2>&1 > dirlist | ||
+ | </ | ||
+ | directs only the standard output to file dirlist, because the standard error was made a copy of the standard output before the standard output was redirected to dirlist. | ||
+ | |||
+ | To conclude, the order of redirections is significant. | ||
+ | |||
+ | Ref:- https:// | ||
===== getopts ===== | ===== getopts ===== | ||
==== useful articles ==== | ==== useful articles ==== | ||
Line 115: | Line 144: | ||
==== add an element to an array ==== | ==== add an element to an array ==== | ||
- | | + | |
+ | < | ||
+ | appliances=(" | ||
+ | appliances+=(" | ||
+ | for appliance in " | ||
+ | do | ||
+ | echo $appliance | ||
+ | done | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | languages=(" | ||
+ | languages[${# | ||
+ | for language in " | ||
+ | do | ||
+ | echo $language | ||
+ | done | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | fruits=(" | ||
+ | fruits=(${fruits[@]} "Jack Fruit" | ||
+ | for fruit in " | ||
+ | do | ||
+ | echo $fruit | ||
+ | done | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | men=(" | ||
+ | women=(" | ||
+ | people=(${men[@]} ${women[@]}) | ||
+ | |||
+ | for person in " | ||
+ | do | ||
+ | echo $person | ||
+ | done | ||
+ | </ | ||
+ | |||
+ | Ref:- | ||
+ | | ||
+ | * https:// | ||
bash_notes.txt · Last modified: 2023/12/28 08:49 by raju