-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random sleep after each command #14
Comments
This would need to support if the user already have a PROMPT_COMMENT function defined, so to not give any indication that something is awry. |
Something like this then? |
If you want the |
Furthermore you might want to consider using Maybe I'm just overthinking this and you can leave it as is (except for the above thing, about re-evaluating properly, which would easily be solved by single quotes and then appending the command by closing the single quotes and starting new double quotes, oh how I hate shells.…) |
Add this to .bashrc etc
export PROMPT_COMMAND='sleep $(($RANDOM % ($(($RANDOM % 9))+1)))'
This will sleep for up to 10 seconds, weighted to lower values:
$ for i in {1..10000}; do echo $(($RANDOM % ($(($RANDOM % 9))+1))); done | sort | uniq -c
3088 0
1999 1
1577 2
1114 3
832 4
590 5
419 6
272 7
109 8
The text was updated successfully, but these errors were encountered: