Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/10/chmod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
echo "creating new file"
touch test
echo "permissions on test file are-"
ls -l
echo "changing permissions on test file"
chmod 777 test
ls -l

echo "Information about the current machine is -"
uname -a




12 changes: 12 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/11/count.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
echo "creating a new file"
echo "enter some lines in the file"
cat > test
echo "Details about file are-"
wc test
echo "The number of lines in test file are-"
wc -l test
echo "Number of words present in test file are-"
wc -w test
echo "All files present in the directory are-"
file *

3 changes: 3 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/11/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hello
this is a test
this is line 3
4 changes: 4 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/12/animals
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
horse
monkey
ant
lion
11 changes: 11 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/12/sort.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
echo "creating a new file animals"
echo "enter some animal names"
cat > animals
echo "creating a new file sports"
echo "enter some sports names"
cat > sports
echo " -sorting animal names in file"
sort animals
echo " -sorting sport names in file"
sort sports

3 changes: 3 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/12/sports
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hokey
badminton
cricket
6 changes: 6 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/13/cut.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
echo "creating a new file"
echo "enter fields and info of sports players"
cat > players
echo "cutting name and age filed to be viewed"
cut -d"-" -f 1,3 players

5 changes: 5 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/13/players
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name-sports-age
abc-ten-30
qwe-ten-29
qaz-ten-33
ert-wdc-28
10 changes: 10 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/14/convert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
echo "creating a text file"
echo "Enter some content in file"
cat > text
echo "converting all lower case to upper case"
dd if=text of=output conv=ucase
cat output
echo "converting text file to europian text file"
dd if=text of=out conv=ebcdic
cat out

1 change: 1 addition & 0 deletions 92_Dollydaga/The Bad Tutorials/14/out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
�������������������������%
1 change: 1 addition & 0 deletions 92_Dollydaga/The Bad Tutorials/14/output
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ABCEFGHIJKLMNOPQRSTUVWXYZ
1 change: 1 addition & 0 deletions 92_Dollydaga/The Bad Tutorials/14/text
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abcefghijklmnopqrstuvwxyz
6 changes: 6 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/15/reduce.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
echo "Generating fancy text using banner command"
banner "harshit"
echo "compressing a text file"
compress -v unix
echo "uncompressing the text file"
uncompress unix.Z
5 changes: 5 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/15/unix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Unix (/ˈjuːnɪks/; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, development starting in the 1970s at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and others.[3]

Initially intended for use inside the Bell System, AT&T licensed Unix to outside parties in the late 1970s, leading to a variety of both academic and commercial Unix variants from vendors including University of California, Berkeley (BSD), Microsoft (Xenix), IBM (AIX), and Sun Microsystems (Solaris). In the early 1990s, AT&T sold its rights in Unix to Novell, which then sold its Unix business to the Santa Cruz Operation (SCO) in 1995.[4] The UNIX trademark passed to The Open Group, a neutral industry consortium, which allows the use of the mark for certified operating systems that comply with the Single UNIX Specification (SUS). As of 2014, the Unix version with the largest installed base is Apple's macOS.[citation needed]

Unix systems are characterized by a modular design that is sometimes called the "Unix philosophy". This concept entails that the operating system provides a set of simple tools that each performs a limited, well-defined function,[5] with a unified filesystem (the Unix filesystem) as the main means of communication,[3] and a shell scripting and command language (the Unix shell) to combine the tools to perform complex workflows. Unix distinguishes itself from its predecessors as the first portable operating system: almost the entire operating system is written in the C programming language, thus allowing Unix to reach numerous platforms.[6]
3 changes: 3 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/18/read.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
echo "Enter your name"
read my_name
echo "Hello $my_name"
1 change: 1 addition & 0 deletions 92_Dollydaga/The Bad Tutorials/19/newname
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello asjdhj
11 changes: 11 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/19/positionalpara.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
echo "Creating a file"
echo "Enter some content to the file"
cat > test
ls
echo "Provide a new name for file"
read name
mv test $name
echo "File name has been changed"
ls
cat $name

11 changes: 11 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/20/positionalpara2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ls -l
chmod 722 $1
ls -l
chmod 775 $1
echo "using set command"
set shell programming is cool
echo $1
echo $2
echo $3
echo $4
echo $*
3 changes: 3 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/21/123.harshit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
qweasdzxc
asdasdffascd
csacasfdaedsa
9 changes: 9 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/21/accentgrave.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ls
echo "using accent grave to change file format"
name=$1
set `whoami`
mv $name $name.$1
ls
echo "using accent grave to print file content"
set `cat sample`
echo $*
3 changes: 3 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/21/sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
123adsads
qwxasxc
ecascc
1 change: 1 addition & 0 deletions 92_Dollydaga/The Bad Tutorials/22/count2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo the total number items in the current directory is=$#
6 changes: 6 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/23/arithmatic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
a=30 b=15
echo `expr $a + $b`
echo `expr $a - $b`
echo `expr $a \* $b`
echo `expr $a / $b`
echo `expr $a % $b`
2 changes: 2 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/24/arithmatic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a=30 b=15 c=2 d=5
echo `expr $a \* \( $b + $c \) / $d`
7 changes: 7 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/25/realnum.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
a=10.5
b=3.5
c=`echo $a + $b | bc`
d=`echo $a - $b | bc`
e=`echo $a \* $b | bc`
f=`echo $a / $b | bc`
echo $c , $d , $e , $f
6 changes: 6 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/26/escape.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
echo "Using escape sequences"
echo "Hey World, \nWhats up ?"
echo "Hey World, \rWhats up ?"
echo "Hey World, \tWhats up ?"
echo "Hey World, \b\b\b\b\b\b\bWhats up ?"
echo "\033[1mHey World, \nWhats up?"
12 changes: 12 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/27/tput.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
tput clear
echo "Total number of rows on screen=\c"
tput lines
echo "Total number of columns on screen=\c"
tput cols
tput cup 5 20
tput bold
echo "this should be in bold"
echo "\033[0mBYE BYE"


8 changes: 8 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/28/if-else.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
echo "Enter source and target file name"
read source target
if mv $source $target
then
echo "Renamming was succesful"
else
echo "Renamming unsuccesful"
fi
8 changes: 8 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/3/calender.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
echo "Calender of current month"
cal
echo "Calender of july 2007"
cal 7 2007
echo "Date is-"
date
echo "date and time are-"
date '+DATE:%m-%y%nTIME:%H:%M:%S'
11 changes: 11 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/30/check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
echo "Enter anumber between 10 and 20"
read num
if [ $num -lt 10 ]
then
echo "That was below range"
elif [ $num -gt 20 ]
then
echo "That was above range"
else
echo "Your number is $num"
fi
18 changes: 18 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/31/file-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
echo "Enter a name:\c"
read fname
if [ -f $fname ]
then
echo "Yes it is a file"
else
echo "It's not a file"
fi

echo "Enter a name:\c"
read fname
if [ -d $fname ]
then
echo "Yes it is a directory"
else
echo "It's not a directory"
fi

12 changes: 12 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/32/apend.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
echo "Enter a name:\c"
read fname
if [ -f $fname ]
then
if [ -w $fname ]
then
echo "Type matter to append. to quit type ctrl+d."
cat >> $fname
else
echo "you do not have permission to write."
fi
fi
2 changes: 2 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/32/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hello , this is a test.
how is it going
15 changes: 15 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/33/string-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
str1="hey You!"
str2="wHATS UP?"
str3=""

[ "$str1" = "$str2" ]
echo $?

[ "$str1" != "$str2" ]
echo $?

[ -n "$str1" ]
echo $?

[ -z "$str3" ]
echo $?
8 changes: 8 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/34/and.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
echo "Enter a number between 50 and 100:\c"
read num
if [ $num -le 100 -a $num -ge 50 ]
then
echo "You are within limits."
else
echo "You are out of limits."
fi
8 changes: 8 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/35/count.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
echo "Enter a character:\c"
read var
if [ `echo $var | wc -c` -eq 2 ]
then
echo "You entered a character."
else
echo "Invalid input."
fi
13 changes: 13 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/36/or.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
echo "Enter a character:\c"
read var
if [ `echo $var | wc -c` -eq 2 ]
then
if [ $var = a -o $var = e -o $var = i -o $var = o -o $var = u ]
then
echo "you entered a vovel"
else
echo "Youd didnt entered a vovel"
fi
else
echo "Invalid input."
fi
19 changes: 19 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/37/case.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
echo "Enter a character:\c"
read var
case $var in
[a-z])
echo "You entered a lowe case alphabet."
;;
[A-Z])
echo "You entered a upper case alphabet."
;;
[0-9])
echo "You entered a digit."
;;
?)
echo "You entered a special symbol."
;;
*)
echo "You entered more than one character."
;;
esac
19 changes: 19 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/38/word.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
echo "Enter a word:\c"
read word
case $word in
[aeiou]* | [AEIOU]*)
echo "The word begins with a vovel."
;;
[0-9]*)
echo "The word begins with a digit."
;;
*[0-9])
echo "The word ends with a digit."
;;
???)
echo "you entered a 3 letter word."
;;
*)
echo "I dont know what you enetred."
;;
esac
6 changes: 6 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/39/while.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
count=1
while [ $count -le 10 ]
do
echo $count
count=`expr $count + 1`
done
7 changes: 7 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/40/until.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#until loop in action
count=1
until [ $count -ge 10 ]
do
echo $count
count=`expr $count + 1`
done
7 changes: 7 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/40/until1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#until loop in action
count=1
until [ $count -gt 10 ]
do
echo $count
count=`expr $count + 1`
done
7 changes: 7 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/41/for.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
for item in *
do
if [ -d $item ]
then
echo $item
fi
done
7 changes: 7 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/41/for1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
for item in *
do
if [ -f $item ]
then
echo $item
fi
done
4 changes: 4 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/42/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a=4.5
b=4.5
[ "$a" = "$b" ]
echo $?
4 changes: 4 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/42/test1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a=4.5
b=4.5
[ $a -eq $b ]
echo $?
5 changes: 5 additions & 0 deletions 92_Dollydaga/The Bad Tutorials/43/grep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
grep -i you test_file
grep -i -n you test_file
grep -i -n -c you test_file
grep -i -n -c -v you test_file
grep -i -v you test_file
Loading