‘bash’ A.K.A. The Solution for Everything – Passed Variables & The Script Filename

When writing a script in bash you can pass parameters into that script to work with. For example, let’s say I have a script file called runme.sh and I want to pass in my name and today’s date. I could do that like this.

./runme.sh "Adron Hall" "12/27/2018"

Inside the script I can get access to the parameters by using the bash param variables of $1, $2, and so on. With a little bash code written up like this.

 


echo "The first parameter $1"
echo "The second parameter is $2"
echo "The \$0 parametere returns the name of the file! This file is named $0."

view raw

bashParams.sh

hosted with ❤ by GitHub

dghubble:go-twitter- Go Twitter REST and Streaming API v1.1 2