projects
/
swc-modular-shell-hello.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c8a0c82
)
Update shell_cheatsheet.md
author
Lynne Williams
<williams.lynne99@gmail.com>
Sun, 17 Feb 2013 16:44:38 +0000
(11:44 -0500)
committer
W. Trevor King
<wking@tremily.us>
Wed, 23 Oct 2013 22:27:29 +0000
(15:27 -0700)
shell_cheatsheet.md
patch
|
blob
|
history
diff --git
a/shell_cheatsheet.md
b/shell_cheatsheet.md
index 2b1e78c56843f7433b7a0729a7d5615e8425ce01..d3671a43227f0d80e1eeb871ece7ff2450c3b8fa 100644
(file)
--- a/
shell_cheatsheet.md
+++ b/
shell_cheatsheet.md
@@
-89,22
+89,10
@@
A special kind of redirection is called a pipe and is denoted by `|`.
changes all the instances of the word `markdown` to `software` in the first 5 `*.md` files in your current directory.
changes all the instances of the word `markdown` to `software` in the first 5 `*.md` files in your current directory.
-## 4. Variables
-### a) Assignment
-* **`varname=1`** -->
-
-### b) Indexing
-* **`varname[0]`** --> _Note:_ the shell is zero indexed. That means you always start counting from zero
-
-### c) Referencing
-* **`${varname}` -->
-* **`${varname[@]` -->
-
-## 5. Loops
-NEED TO DO VARIABLE ASSIGNMENT FIRST!!!!
-### a) How to repeat operations using a loop...
+## 4. How to repeat operations using a loop...
+### a) For loop
for varname in list
do
for varname in list
do
@@
-128,17
+116,10
@@
where,
.
list[n]=Mark
.
list[n]=Mark
-
+_Note:_ Bash is zero indexed, so counting always starts at `0`, not `1`.
-*
-
-
-* **`for`** -->
- `for filename in *.dat
- do
- mv ${filename} ${newname}
- done`
+### b) While Loop
* **`while`** -->
`count=0
* **`while`** -->
`count=0