Skip to content

Instantly share code, notes, and snippets.

View seeni-dev's full-sized avatar

Seeni seeni-dev

View GitHub Profile
@seeni-dev
seeni-dev / shell-variables.sh
Last active September 21, 2018 08:11
shell declaring varaibles
numberVariable=3;
realVariable=3.14;
stringVariable_1=pi;
stringVariable_2="pi";
@seeni-dev
seeni-dev / shell-if.sh
Created September 21, 2018 08:25
shell if condition
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
i=0
while [ $i -lt 10 ]
do
echo $i;
i=$((i+1)); #increment the varaible i
done
for i in 1 2 3 4 5 6
do
echo $i;
done
i=5;
echo $((1+2));
echo $(($i-3));
echo $((7/2));
echo $((7%5));
if [ 3 -eq 3 -a 3 -ge 2 ]
then
echo "work begins";
fi
if [ ! 3 -ge 4 ]
then
echo "! 3>4";
fi
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
@seeni-dev
seeni-dev / genFile.g
Created September 28, 2018 07:54
genFile specification File for generating ALL.txt
ex1.l
ex2.l
@seeni-dev
seeni-dev / genAll.sh
Created September 28, 2018 07:55
shell script for generating ALL.txt
echo "">ALL.txt
while read line
do
echo "//file name " $line >> ALL.txt
cat $line >> ALL.txt
done < genFile.g
@seeni-dev
seeni-dev / problem_216.py
Last active August 10, 2019 10:53
Daily Coding Problem 216 -> roman numeral to decimal
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,