Skip to content

Instantly share code, notes, and snippets.

@harishkannarao
Last active August 11, 2023 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harishkannarao/50c4c32aca762cdc675acfdb095eb05d to your computer and use it in GitHub Desktop.
Save harishkannarao/50c4c32aca762cdc675acfdb095eb05d to your computer and use it in GitHub Desktop.
#!/bin/bash
# Make the script to abort if any command fails. Use set +e to change the behaviour and ignore failed command.
set -e
# Uncomment below line to print the commands as it is executed. Useful for debugging. Use set +x to disable debugging.
# set -x
# Source the functions from an url
source <(curl -s "https://gist.githubusercontent.com/harishkannarao/58d317f2743c842b5323165a492db81c/raw/75ee691d4d4568c59443a070c6e5d192d717b6bc/reusable_functions.sh")
# Source it from local script
# source reusable_functions.sh
ADD_RESULT=$(add 2 3)
echo "Addition result: $ADD_RESULT"
SUBTRACT_RESULT=$(subtract 4 3)
echo "Subtraction result: $SUBTRACT_RESULT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment