Predictive Hacks

Functions with Parameters in Bash

This is an example of how you can run a function with parameters in Bash. This function, at the beginning will ask for the first input which is the “name” and then it will ask for the same input which is the “age” and it will convert the age in years to days.

# global variable

 echo "Hello $USERNAME, You are $1 Years Old."
 echo "That makes you approximately `expr $1 \* 365` days old"

echo "Enter Your Age: "


Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore


Image Captioning with HuggingFace

Image captioning with AI is a fascinating application of artificial intelligence (AI) that involves generating textual descriptions for images automatically.


Intro to Chatbots with HuggingFace

In this tutorial, we will show you how to use the Transformers library from HuggingFace to build chatbot pipelines. Let’s