In this post we are sharing the script to change group from a file having list of users. You can do the changes in script as per your requirement. The script is also using the /etc/group file to validate group names which could be existing in user supplied group file. Given below is the sample […]
bash script
Set and reset user password by bash script
In this post learn how to set and reset user password by bash script on Linux systems. It is quite good for Linux System Admin who wants to know how to set and reset user account password with bash script. We have used the standard input (stdin) with passwd command. Advantage: 1. Get the list […]
How To Use opt In Bash Script
How To Use opt In Bash Script,Example This is an exmaple of how to create bash script with Opt in. #!/bin/bash echo “Select no. for option” OPTIONS=”Hello LinuxTribe Quit” select opt in $OPTIONS; do if [ “$opt” = “Quit” ]; then echo done exit elif [ “$opt” = “Hello” ]; then echo Hello World elif […]
How To Use case in Bash Script, Example
How To Use case in Bash Script, Example This is only an example. #/bin/bash echo “Give Full Path where the file is located” read pth echo “Give the file name” read fle if [ -f $pth/$fle ];then echo “$fle file is found in $pth” else echo “$fle file not found in $pth” echo “U r […]
How to Use Expect In Bash Script
In this bash script we will use expect scripting. Expect is known primarily as an indispensable application for system administrators. We use expect generally in case where input from user is required , for eg. ssh, ftp, telnet, sudo etc. Given below is sample bash script which will first ssh the remote host and then […]
Recent Comments