Skip to content

Commit

Permalink
[shell] variable
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhang-gh committed Jul 15, 2024
1 parent ccc1175 commit 9ec8daf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/software/shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,16 @@ $ echo 'hello $a' ## single-quoted strings are interpreted literally
hello $a
```

使用 for 循环

```
for i in {1..10} ## press `Enter` here and continue typing
echo $i
## 更多处理
echo $(printf %02d $i) ## 01 02 03 ...
echo $(printf %02d $(($i * 2))) ## 02 04 06 ...
```

```shelldoc
## in the `.bashrc` file
export rds='[email protected]:/rds'
Expand Down

0 comments on commit 9ec8daf

Please sign in to comment.