This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numberVariable=3; | |
realVariable=3.14; | |
stringVariable_1=pi; | |
stringVariable_2="pi"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ $a -eq $b ] # -eq tests whether left operand is equal to the right operand | |
then | |
echo "a is equal to b" | |
else | |
echo "a and b are not equal" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i=0 | |
while [ $i -lt 10 ] | |
do | |
echo $i; | |
i=$((i+1)); #increment the varaible i | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in 1 2 3 4 5 6 | |
do | |
echo $i; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i=5; | |
echo $((1+2)); | |
echo $(($i-3)); | |
echo $((7/2)); | |
echo $((7%5)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ 3 -eq 3 -a 3 -ge 2 ] | |
then | |
echo "work begins"; | |
fi | |
if [ ! 3 -ge 4 ] | |
then | |
echo "! 3>4"; | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in `seq 5` #consider that we have 5 seasons | |
do | |
mkdir S$i; # creating directory | |
mv *S$i* S$i; #moving the files | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ex1.l | |
ex2.l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "">ALL.txt | |
while read line | |
do | |
echo "//file name " $line >> ALL.txt | |
cat $line >> ALL.txt | |
done < genFile.g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given a number in Roman numeral format, convert it to decimal. | |
The values of Roman numerals are as follows: | |
{ | |
'M': 1000, | |
'D': 500, | |
'C': 100, | |
'L': 50, | |
'X': 10, |
OlderNewer