File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ echo " This is my First Shell Script"
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ NAME=" VIJAY"
4+
5+ echo " Hello Mr ${NAME} "
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # This is first variable declaration
4+ NAME=" vijay"
5+
6+ # This is second variable
7+ Name=" Pater"
8+
9+ # This is Third variable
10+ name=" james"
11+
12+ # Print NAME Variable
13+ echo " My Name is ${NAME} "
14+
15+ # Print Name variable
16+ echo " My Name is ${Name} "
17+
18+ # Print name variable
19+ echo " My name is ${name} "
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # This is script use for getting system information
4+
5+ # Script start here
6+ echo " Script Begain here:::"
7+
8+ # Current date of system
9+ date
10+
11+ # Display Hostname of system
12+ hostname
13+
14+ # Display Kernel information
15+ uname -r
16+ uname -m
17+
18+ # Display Disk Utilization
19+ df -h
20+
21+ # Display memory Utilization
22+ free -h
23+
24+ # Script Ends here
25+ echo " script completed"
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ username=$( whoami)
4+ echo $username
5+
6+ if [[ " ${username} " == " root" ]]:
7+ then
8+ echo " you are root user"
9+ else
10+ echo " you are not root user"
11+ fi
You can’t perform that action at this time.
0 commit comments