Tag archives for scripting

Scripting

How to concatenate string variables in Bash

Here are few preferred ways to concatenate string variables in bash script Concatenate string variables in Bash the variable one after another in echo #!/bin/bash var1="Techieroop" var2="${var1} Tutorial" echo "${var2}" ##output Techieroop Tutorial 2. Use += assignment operator: #!/bin/bash var="Techieroop" var+=" Tutorial" echo "$var" ##output Techieroop Tutorial Second method can be…
Continue Reading
Programming

Find two numbers whose sum is equal to a given number in sorted array

Find two numbers whose sum is equal to a given number in sorted array In order to find the sum of the two array elements you need to traverse in array and check the sum of each element. Let's take an example of below sorted array in which we have to perform below iteration to find the sum of the array element. First Iteration: 1 51 61 81 10 Second…
Continue Reading
12
Verified by MonsterInsights