place posix shell warnings
This commit is contained in:
parent
aa34b8b6e8
commit
912eeb478b
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Terminal Tips"
|
title: "bash tips"
|
||||||
tags: [ "Documentation", "System" ]
|
tags: [ "Documentation", "Shell", "POSIX" ]
|
||||||
---
|
---
|
||||||
## Track Live Changes
|
## Track Live Changes
|
||||||
|
|
||||||
@ -67,6 +67,18 @@ Add number to variables with:
|
|||||||
|
|
||||||
`((n--))` works identically.
|
`((n--))` works identically.
|
||||||
|
|
||||||
|
### POSIX WARNING
|
||||||
|
|
||||||
|
The number commands above work in `bash`, but not in bare-ass POSIX shells, such as `dash`.
|
||||||
|
|
||||||
|
Instead, you might do:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
x=2
|
||||||
|
x=$(( x +1 ))
|
||||||
|
x=$(( x*x ))
|
||||||
|
```
|
||||||
|
|
||||||
## Finding Duplicate Files
|
## Finding Duplicate Files
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -97,3 +109,8 @@ That gives you a random directory to mess about in.
|
|||||||
cd $dir
|
cd $dir
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### POSIX WARNING
|
||||||
|
|
||||||
|
These smart-brackets are a bash feature.
|
||||||
|
If you try to use `{A..Z}` in dash, it will think of this as a single item.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user