A script is just a series of commands, so you could put it into a bash script.
#!/bin/bash
command 1
command 2
command 3
Now, this all depends on the they types of command and whether or not they require user intervention.
However, if you are getting diagnostic info, for example, you can have a script that does
#!/bin/bash
# Get SMART status of main drive
diskutil info disk0 | grep -i smart
# Get the model of the machine in question
system_profiler SPHardwareDataType | grep -i Identifier
Those are just to examples. Keep in mind that any output generated, will get sent to the console (screen). However, you can redirect the output to a file by appending >> /path/to/outputfile.txt
at the end of each command so you have a file which you can parse once the file has finished running.
You can name the file diagnostics.sh
and place it anywhere you like. Just make sure you make it executable by issuing the command chmod +x diagnostics.sh
and use ./diagnostics.sh
to execute it or double click on it to run it if it's saved to your desktop.
alias
e.g.alias ns="sudo netstat -tulpn"
. You could even put these in@reboot
lines on Crontab if you wanted them on every boot. Now I can just typens
. Bliss.