Best Practices

Keep in mind these important tips

As you develop your scripts that utilize, you should keep in mind the following:

  • Maintain a list of scripts and code files that call the script.
  • Use recursive grep to find files that are calling, for example:
# look in all the php files to see which ones are calling
find /var/www -name "*.php" -type f | xargs grep -l

# look in my ~/bin directory to see which files are calling
find ~/bin/ -type f | xargs grep -l
  • You can safely disable the script simply by adding exit as a line of code directly under #!/bin/bash
  • While you are developing a new script, send the messages to the test chatroom by using “test” as the second parameter.
  • Avoid placing the script in any loop. It could get your server blocked! It is better to aggregate the results of a loop and send them in a single message after the loop has completed.
  • Use a desktop XMPP client to review your messages while you are developing scripts.
Last modified December 4, 2020