This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In Python, function is a group of related statements that perform a specific task. | |
Functions help break our program into smaller and modular chunks. As our program grows larger and larger, functions make it more organized and manageable. | |
Furthermore, it avoids repetition and makes code reusable. | |
Syntax of Function | |
def function_name(parameters): | |
"""docstring""" | |
statement(s) | |
Above shown is a function definition which consists of following components. | |
Keyword def marks the start of function header. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
##Author: Sahil Badyal <[email protected]> | |
usage() | |
{ | |
echo "usage: sysinfo_page [[[-f file ] [-i]] | [-h]]" | |
} | |
if [ "1" == "" ]; then | |
usage | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Author Sahil Badyal <[email protected]> | |
## This script setups the cluster env for tf | |
clusterid=$(aws emr list-clusters --active | jq '.Clusters' | jq '.[]' -c | grep <CLUSTER_NAME> | jq '.Id' | tr -d '"') | |
num=0 | |
tot="$1" | |
if [ "2" != "" ]; then | |
numParameterServers="$2" | |
else |