Skip to content

Commit c585ef4

Browse files
authored
Add files via upload
0 parents  commit c585ef4

12 files changed

+195
-0
lines changed

sc/01-hello.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
echo "Hello Guys"
4+
echo "Welcome to ShellScript"
5+
echo "This is the first shell script example !!"
6+
echo "Today date is"
7+
date
8+
echo "Shellscript is very easy"
9+
10+
11+

sc/02-comments.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<<Password
2+
1. configure password authentication
3+
sudo vi /etc/ssh/sshd_config
4+
PaswordAuthentication yes # change from no to yes
5+
sudo systemctl restart sshd && sudo passwd ec2-user
6+
7+
2. ssh ec2-ser@publicIP
8+
9+
Password
10+
11+
#!/bin/bash
12+
<<sp
13+
Title : Learning comment
14+
description :
15+
author :myLANDMARK.tech S Legah
16+
date :08112012
17+
version :1.0
18+
Tel :437 215 2483
19+
pwd
20+
sp
21+
<<comment
22+
This script is for beginners.
23+
Learn how to write simple script
24+
Linux is very easy to understand.
25+
This script was written by LandmarkTechnology
26+
comment
27+
echo "example about using multi-line comment"
28+
#echo "This line is commented""
29+
#echo "This line is commented"
30+
echo "This is in Multi line comment section"
31+
echo "This line aslo in Multi line comment section, it will be ignore"
32+
COMMENT
33+
echo "This is after Multiline comments section"

sc/03-system_defined_vars.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
#title :
3+
#description :
4+
#author :myLANDMARK.tech S Legah
5+
6+
echo "SHELL is: " $SHELL
7+
echo "BASH_VERSION is: " $BASH_VERSION
8+
echo 'HISTSIZE is: '$HISTSIZE
9+
echo 'SSH_CLIENT is: '$SSH_CLIENT

sc/04-user_defined_vars.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
#title :
3+
#description :
4+
#author :myLANDMARK.tech S Legah
5+
#date :08112012
6+
#version :1.0
7+
#Tel :437 215 2483
8+
9+
name="Simon Legah"
10+
id=08112012
11+
12+
echo "The name varibale value is: "$name
13+
echo "The id variable value is: "$id
14+
15+

sc/05-command_line_args1.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
#title :
3+
#description :
4+
#author :myLANDMARK.tech S Legah
5+
#date :08112012
6+
#version :1.0
7+
#Tel :437 215 2483
8+
9+
10+
#Number of arguments on the command line.
11+
echo '$#:' $#
12+
#Process number of the current process.
13+
echo '$$:' $$
14+
#Display the 3rd argument on the command line, from left to right.
15+
echo '$3:' $3
16+
#Display the 10th argument on the command line, from left to right.
17+
echo '${10}:' ${10}
18+
#Display the name of the current shell or program.
19+
echo '$0:' $0
20+
#Display all the arguments on the command line using * symbol.
21+
echo '$*:' $*
22+
#Display all the arguments on the command line using @ symbol.
23+
echo '$@:' $@
24+
date
25+
echo '$?:' $?

sc/05-command_line_args2.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
#title :
3+
#description :
4+
#author :myLANDMARK.tech S Legah
5+
#date :08112012
6+
#version :1.0
7+
#Tel :437 215 2483
8+
9+
#if (( $# >= 3 ))
10+
#if [ $# -gt 3 ]
11+
#if [ $# -lt 3 ]
12+
if (( $# == 3 ))
13+
then
14+
#Number of arguments on the command line.
15+
echo '$#:' $#
16+
#Process number of the current process.
17+
echo '$$:' $$
18+
#Display the 3rd argument on the command line, from left to right.
19+
echo '$3:' $3
20+
#Display the 10th argument on the command line, from left to right.
21+
echo '${10}:' ${10}
22+
#Display the name of the current shell or program.
23+
echo '$0:' $0
24+
#Display all the arguments on the command line using * symbol.
25+
echo '$*:' $*
26+
#Display all the arguments on the command line using @ symbol.
27+
echo '$@:' $@
28+
date
29+
echo '$?:' $?
30+
else
31+
echo "Please Pass the 3 command line args along with script"
32+
fi

sc/07-string.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
#title :
3+
#description :
4+
#author :myLANDMARK.tech S Legah
5+
6+
string_var="Hi Team, My name is Simon Legah, working in MLT, GTA "
7+
8+
echo "The value of string_var value is: " ${string_var}
9+
10+
echo "The length of the string is: " ${#string_var}
11+
12+
echo "The sub string is:" ${string_var:20:14}
13+
14+
#Index from right end of the string
15+
echo The sub tring value is: ${string_var: (-8)}
16+
17+
echo The sub tring value is: ${string_var: -17}
18+

sc/08-arithmetic_operations.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
#title : Arithmetic operations
3+
4+
expr 3 + 2
5+
expr 3 - 2
6+
expr 3 \* 2
7+
expr 10 / 2
8+
expr 20 % 3
9+
echo addition of 3 and 2 is : `expr 3 + 2`
10+

sc/09-arrya.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
#title :
3+
#description :
4+
#author :myLANDMARK.tech S Legah
5+
#date :08112012
6+
#version :1.0
7+
#Tel :437 215 2483
8+
#usage :
9+
10+
declare -a devopstools
11+
devopstools[0]=GitHub
12+
devopstools[1]=Ant
13+
devopstools[2]=Maven
14+
devopstools[3]=Tomcat
15+
devopstools[4]=Wildfly
16+
devopstools[5]=SonarQube
17+
18+
19+
#Displaying 1st value
20+
echo ${devopstools[0]}
21+
22+
#Displaying 5th value
23+
echo ${devopstools[4]}
24+
25+
#Displaying all values
26+
echo ${devopstools[*]}
27+
28+
#Displaying all values
29+
30+
echo ${devopstools[@]}

sc/09-read0.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
echo "Please enter your name"
4+
read name
5+
echo "Your name is: " $name
6+
echo please enter 1st number1
7+
read number1
8+
echo please enter 2nd number2
9+
read number2
10+
echo The sum is `expr $number1 + $number2`

sc/1.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0

sc/2.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0

0 commit comments

Comments
 (0)