-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbash_examples.sh
29 lines (22 loc) · 1.27 KB
/
bash_examples.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Notice how when using python you can call to the module folder
# instead of the actual .py script.
# Executing 'python snappy_sms' and 'python snappy_sms/__main__.py'
# are completely equivalent options, though the first one is recommended
# for simplicity.
# Sends a message to 600000000. Uses the username and password defined in snappy_sms/__init__.py
python snappy_sms 600000000 "hello world!"
# Same, but prints out details on destination number, message and success
python snappy_sms -v snappy_sms 600000000 "hello world!"
# Same, but uses 611111111 as username and 'mypass' as password instead of those defined in snappy_sms/__init__.py
python snappy_sms -l 611111111 -p mypass 600000000 "hello world!"
# Verbose option is available and confirms which username we are using
python snappy_sms -v -l 611111111 -p mypass 600000000 "hello world!"
# Alternatively, the executable python script 'execute.py' can be called with
# the same parameters.
# It is important to have previously give execution permissions to that file by
# executing 'chmod +x execute.py'
./execute.py 600000000 "hello world!"
./execute.py -v snappy_sms 600000000 "hello world!"
./execute.py -l 611111111 -p mypass 600000000 "hello world!"
./execute.py -v -l 611111111 -p mypass 600000000 "hello world!"