How to distribute my Python/shell script?
bash, python, shell
Solution
Upload your script to something like ideone. Then tell your friend to pipe it into `python`. Example script:
def print_message():
print "This is my very special script!"
if __name__ == "__main__":
print_message()
Example of running script:
username@server:~$ curl http://ideone.com/plain/O2n3Pg 2>/dev/null | python
This is my very special script!
Problem
I have written a very simple command line utility for myself. The setup consists of: - A single .py file containing the application/source. - A single executable (chmod +x) shell script which runs the python script. - A line in my .bash_profile which aliases my command like so: `alias cmd='. shellscript'` (So it runs in the same terminal context.) So effectively I can type `cmd` to run it, and everything works great. My question is, how can I distribute this to others? Obviously I could just write out these instructions with my code and be done with it, but is there a faster way? I've occasionally seen those one-liners that you paste into your console to install something. How would I do that? I seem to recall them involving `curl` and piping to `sh` but I can't remember.