79dd4fc643dea41afc52071aba1ed37deb6fd67d
shells/bash.md
| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | # bash |
| 2 | 2 | |
| 3 | -use parameter of previous command ([ref 1](#ref#1)) |
|
| 3 | +use parameter of previous command ([ref 1][1]) |
|
| 4 | 4 | ``` |
| 5 | 5 | mkdir test |
| 6 | 6 | cd $_ |
| ... | ... | @@ -16,7 +16,7 @@ cd !$ |
| 16 | 16 | find . -type f -iname "*regex*" -exec rm -f {} \; |
| 17 | 17 | ``` |
| 18 | 18 | |
| 19 | -## when was user created [ref_2](#ref#2) |
|
| 19 | +## when was user created ([ref_2][2]) |
|
| 20 | 20 | - if user has never logged in after account creation |
| 21 | 21 | ``` |
| 22 | 22 | ls -l /home/<user>/.bash_logout |
| ... | ... | @@ -35,7 +35,15 @@ _where 1 is the job number_ |
| 35 | 35 | && Command 1 && Command 2 Run command 2 only if command 1 ends sucessfully |
| 36 | 36 | || Command 1 || Command 2 Run command 2 only if command 1 fails |
| 37 | 37 | |
| 38 | +## sneaky workarounds |
|
| 39 | +* disable logoug timeout ([stackexchange][3]) |
|
| 40 | +``` |
|
| 41 | +if [ ! -z "$TMOUT" ]; then |
|
| 42 | + env -i bash --init-file ~/.bash_profile |
|
| 43 | +fi |
|
| 44 | +``` |
|
| 38 | 45 | |
| 39 | 46 | ## ref |
| 40 | -- :1: https://unix.stackexchange.com/questions/125385/combined-mkdir-and-cd |
|
| 41 | -- :2: https://it.toolbox.com/question/how-to-find-out-when-a-user-is-created-in-linux-030612 |
|
| 47 | +[1]: https://unix.stackexchange.com/questions/125385/combined-mkdir-and-cd |
|
| 48 | +[2]: https://it.toolbox.com/question/how-to-find-out-when-a-user-is-created-in-linux-030612 |
|
| 49 | +[3]: https://unix.stackexchange.com/a/222311 |