How to join variables in a bash script

To join/concatenate two variables in bash-script use following: 1) “${var1}_${var2}” # here we have joined var1 and var2 separated by ‘_’ 2) basePath=”/home/anj/” # base part. fileName=”myfile.txt” # fitename fileName=”${basePath}/${fileName}” # separated by / It is quite simple just place each variable adjacent to each other. ${basePath}/${fileName}” avoid variable substitution issues (if any).

How to write a custom command on linux

I want to create a custom command on linux (ubantu) which I need to execute regularly. steps are: create a shell-script place the shell script in /usr/bin/ dir name of shell-script file is custom command e.g I want kill node processes running by just typing “killnode” #!/bin/bash #fileName /usr/bin/killnode #echo "the folder is `pwd`" #echo