Shell-scripting

Bash Script: Generate Pascal triangle

Problem statement:- Write a bash script to print pascal triangle. Input :- Number of row and Output:-  Wiki :- In  mathematics ,  Pascal's triangle  is a  triangular array  of the  binomial coefficients .  #!/bin/bash #generate pascal tria…

Bash Shell Script Sample Code - Part 2

1.  Write a bash script to find GCD and LCM of two number. #!/bin/bash #find GCD and LCM of two numbers printf "Enter first nuumber: " read n1 printf "Enter second nuumber: " read n2 m = $n1 n = $n2 r = $n2 while [ …

Bash Shell Script Sample Code - Part 1

1. Read user input and display message Welcome #!/bin/bash echo 'read_input=?' ; read read_input echo "Welcome on $read_input" Sample output: read_input=? Devinline Welcome on Devinline   2. Print Even natura…

Load More
That is All