Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute Bash Shell Online

#!/bin/sh
read -p "enter the no. of element" n

for((i=0; i < n; i++))
{
read -p "enter elements" a[i]
}
k=0
	while((k<n))
	{
	i=$k
		for((j=$i+1;j<n;j++))
		{
		if(($a[i]>$a[j]))
		then
		i=$j
		fi
		}
	temp=$a[k]
	a[k]=$a[i]
	a[i]=$temp
	((k++))
	}

for((l=0;l<n;l++))
do
echo $a[l]
done
exit 0

This is to practice bashshell online

# Hello World Program in Bash Shell

a=2
b=2
c=`expr $a + $b`
echo $c

SHell en bash Asdsd123123

# Hello World Program in Bash Shell

echo "Hello World!" 

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.