commit 79dd4fc643dea41afc52071aba1ed37deb6fd67d parent c192a9e4edc8e3cf5d90ab912ef0f0a9561a7f60 Author: pyratebeard <root@pyratebeard.net> Date: Tue, 14 May 2024 12:07:38 +0100 updates Diffstat:
M | shells/bash.md | | | 16 | ++++++++++++---- |
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/shells/bash.md b/shells/bash.md @@ -1,6 +1,6 @@ # bash -use parameter of previous command ([ref 1](#ref#1)) +use parameter of previous command ([ref 1][1]) ``` mkdir test cd $_ @@ -16,7 +16,7 @@ cd !$ find . -type f -iname "*regex*" -exec rm -f {} \; ``` -## when was user created [ref_2](#ref#2) +## when was user created ([ref_2][2]) - if user has never logged in after account creation ``` ls -l /home/<user>/.bash_logout @@ -35,7 +35,15 @@ _where 1 is the job number_ && Command 1 && Command 2 Run command 2 only if command 1 ends sucessfully || Command 1 || Command 2 Run command 2 only if command 1 fails +## sneaky workarounds +* disable logoug timeout ([stackexchange][3]) +``` +if [ ! -z "$TMOUT" ]; then + env -i bash --init-file ~/.bash_profile +fi +``` ## ref -- :1: https://unix.stackexchange.com/questions/125385/combined-mkdir-and-cd -- :2: https://it.toolbox.com/question/how-to-find-out-when-a-user-is-created-in-linux-030612 +[1]: https://unix.stackexchange.com/questions/125385/combined-mkdir-and-cd +[2]: https://it.toolbox.com/question/how-to-find-out-when-a-user-is-created-in-linux-030612 +[3]: https://unix.stackexchange.com/a/222311