File tree Expand file tree Collapse file tree 10 files changed +169
-0
lines changed Expand file tree Collapse file tree 10 files changed +169
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Purpose: eval command Evaluating twice
3+ # Version:1.0
4+ # Created Date: Wed Jun 13 22:09:59 IST 2018
5+ # Modified Date:
6+ # WebSite: https://arkit.co.in
7+ # Author: Ankam Ravi Kumar
8+ # START #
9+
10+ echo " addition of X+Y"
11+ echo " Enter X"
12+ read X
13+ echo " Enter Y"
14+ read Y
15+ echo " X+Y = $X +$Y = $[ X+Y ]"
16+
17+ # END #
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Purpose: eval command Evaluating twice
3+ # Version:1.0
4+ # Created Date: Wed Jun 13 22:09:59 IST 2018
5+ # Modified Date:
6+ # WebSite: https://arkit.co.in
7+ # Author: Ankam Ravi Kumar
8+ # START #
9+
10+ echo " enter the a vloue $a "
11+ read a
12+ echo " enter the b volue $b "
13+ read b
14+ if test " $a " -gt " $b " ; then
15+ echo " $a is greater than $b "
16+ else
17+ echo " $b is greater than $a "
18+ fi
19+
20+ # END #
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Purpose: eval command Evaluating twice
3+ # Version:1.0
4+ # Created Date: Wed Jun 13 22:09:59 IST 2018
5+ # Modified Date:
6+ # WebSite: https://arkit.co.in
7+ # Author: Ankam Ravi Kumar
8+ # START #
9+
10+ echo " WEL COME TO $USER "
11+ echo " Your present working directory is ` pwd` "
12+ echo " current logged in users are ` who` "
13+ echo " Today date is ` date` "
14+
15+ # END #
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Purpose: eval command Evaluating twice
3+ # Version:1.0
4+ # Created Date: Wed Jun 13 22:09:59 IST 2018
5+ # Modified Date:
6+ # WebSite: https://arkit.co.in
7+ # Author: Ankam Ravi Kumar
8+ # START #
9+
10+ echo " current location files are ` ls` "
11+ echo " current working directory is ` pwd` "
12+
13+ # END #
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Purpose: eval command Evaluating twice
3+ # Version:1.0
4+ # Created Date: Wed Jun 13 22:09:59 IST 2018
5+ # Modified Date:
6+ # WebSite: https://arkit.co.in
7+ # Author: Ankam Ravi Kumar
8+ # START #
9+
10+ tmp=` date | cut -c12-13`
11+ if [ $tmp -lt 11 ] ; then
12+ echo " Good Mornind have a nice day $USER "
13+ elif [ $tmp -gt 11 -a $tmp -lt 16 ] ; then
14+ echo " Good Ofter noon $USER "
15+ elif [ $tmp -gt 15 -a $tmp -lt 19 ] ; then
16+ echo " Good Evening $USER "
17+ else
18+ echo " Good Night Sweet dreams $USER "
19+ fi
20+ echo " Now the time is ` date | cut -c12-19` "
21+
22+ # END #
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Purpose: eval command Evaluating twice
3+ # Version:1.0
4+ # Created Date: Wed Jun 13 22:09:59 IST 2018
5+ # Modified Date:
6+ # WebSite: https://arkit.co.in
7+ # Author: Ankam Ravi Kumar
8+ # START #
9+
10+ echo " Hi you there"
11+ echo " what is your name? (Type your name here and press Enter)"
12+ read NM
13+ echo " Hi $NM Good Morning"
14+ echo " your currently logged in as $USER "
15+ echo " your present working directory is ` pwd` "
16+
17+ # END #
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Purpose: eval command Evaluating twice
3+ # Version:1.0
4+ # Created Date: Wed Jun 13 22:09:59 IST 2018
5+ # Modified Date:
6+ # WebSite: https://arkit.co.in
7+ # Author: Ankam Ravi Kumar
8+ # START #
9+
10+ echo " multification of X*Y"
11+ echo " Enter X"
12+ read X
13+ echo " Enter Y"
14+ read Y
15+ echo " X*Y = $X *$Y = $[ X*Y ]"
16+
17+ # END #
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Purpose: eval command Evaluating twice
3+ # Version:1.0
4+ # Created Date: Wed Jun 13 22:09:59 IST 2018
5+ # Modified Date:
6+ # WebSite: https://arkit.co.in
7+ # Author: Ankam Ravi Kumar
8+ # START #
9+
10+ echo " ecnter the user name $NM "
11+ read NM
12+ echo " ` useradd -d /users/$NM $NM ` "
13+
14+ # END #
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Purpose: eval command Evaluating twice
3+ # Version:1.0
4+ # Created Date: Wed Jun 13 22:09:59 IST 2018
5+ # Modified Date:
6+ # WebSite: https://arkit.co.in
7+ # Author: Ankam Ravi Kumar
8+ # START #
9+
10+ echo " WEl COME TO $USER "
11+ echo " Your present Wroking Directory is ` pwd` "
12+ echo " Present Processes are ` ps -a` "
13+ echo " Now Time is ` date` "
14+ echo " current logged in Details are ` finger $USER ` "
15+
16+ # END #
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Script to add a user to Linux system
3+ if [ $( id -u) -eq 0 ]; then
4+ read -p " Enter username : " username
5+ read -s -p " Enter password : " password
6+ egrep " ^$username " /etc/passwd > /dev/null
7+ if [ $? -eq 0 ]; then
8+ echo " $username exists!"
9+ exit 1
10+ else
11+ pass=$( perl -e ' print crypt($ARGV[0], "password")' $password )
12+ useradd -m -p $pass $username
13+ [ $? -eq 0 ] && echo " User has been added to system!" || echo " Failed to add a user!"
14+ fi
15+ else
16+ echo " Only root may add a user to the system"
17+ exit 2
18+ fi
You can’t perform that action at this time.
0 commit comments