Tag archives for 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}"…
How to check if a string contains a substring in Bash
Here are the couple of methods to check if a string contains a substring in bash shell script. Methods to check if string contains a substring in Bash Method 1:…
How to check if file does not exist in Bash?
Check if file does not exist in Bash Script? You can use -f option in bash script to check if file does not exist. Check if file does not exists…
How to check if a directory exists in a bash script?
How to check if a directory exists in a bash script? In shell script implementation you might come across use case where you need to perform some operation in a…
Find the largest and smallest number in python using for loop
Write a python program to find the largest and smallest number in python using for loop Assign first element of an array to largest(lt) and smallest (st) value the array…
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…
Bubble sort program in python
Write a Program in Python to execute Bubble sort program What is Bubble Sort Program ? Bubble sort is a simple sorting algorithm that compares adjacent elements and swaps them…
Program to print Fibonacci series in python
The Fibonacci numbers, commonly refers as Fibonacci sequence, in which each number is the sum of the two preceding numbers, starting from 0 and 1. The Fibonacci Sequence is the…
Reverse String in Python using Recursion
Let's understand what is the recursion in programming with reverse string in Python program Recursion is a process by which a function calls itself directly or indirectly. The corresponding function is called as recursive…
Shell Script Questions and Answers
Please find below list of Shell Script Questions and Answers. Shell Script Questions and Answers 1. Given two integers, X and Y , find their sum, difference, product, and quotient. Constraints X…