Bourne Shell
C Shell
Korn Shell
Bash,the Bourne Again Shell
TCSH, the T C Shell
Graphical Shells
Common Desktop Environment or CDE
GNOME
KDE
POSIX(Portable Operating System Interface for Computing Environment)
For working in shell script in windows OS use Cygwin
Shell Script
To Identify the number of Arguments use $#
To get all arguments value use $@
To get each argument use $1(First), $2(second)
To get the Name of the script we use $0
To get the return code from script or function we use $?
To read data from the user use the command read
echo -n "Please enter the amount of purchase : "
read amount
echo -n "Please enter the total sales tax :"
read rate
To run the script in debug mode we have two options
-n (noexec or no execution)
-v (verbose)
-x (xtrace or execution trace)
-n option tells the shell to not run the commands. Instead check for syntax errors.
Eg : sh -n sample.sh
-v option tells the shell to run in verbose mode.In practice this means that the shell will echo each command prior to executing the command
Eg : sh -v sample.sh
We can combine the -n and -v option also
Eg: sh -nv sample.sh
-x option tells the shell to echo each command after performing the substitution steps.Thus, you'll see the value of variables and commands
Eg: sh -x listusers
In windows we have Robocop similar in Linux we have rsync
C Shell
Korn Shell
Bash,the Bourne Again Shell
TCSH, the T C Shell
Graphical Shells
Common Desktop Environment or CDE
GNOME
KDE
POSIX(Portable Operating System Interface for Computing Environment)
For working in shell script in windows OS use Cygwin
Shell Script
To Identify the number of Arguments use $#
To get all arguments value use $@
To get each argument use $1(First), $2(second)
To get the Name of the script we use $0
To get the return code from script or function we use $?
To read data from the user use the command read
echo -n "Please enter the amount of purchase : "
read amount
echo -n "Please enter the total sales tax :"
read rate
To run the script in debug mode we have two options
-n (noexec or no execution)
-v (verbose)
-x (xtrace or execution trace)
-n option tells the shell to not run the commands. Instead check for syntax errors.
Eg : sh -n sample.sh
-v option tells the shell to run in verbose mode.In practice this means that the shell will echo each command prior to executing the command
Eg : sh -v sample.sh
We can combine the -n and -v option also
Eg: sh -nv sample.sh
-x option tells the shell to echo each command after performing the substitution steps.Thus, you'll see the value of variables and commands
Eg: sh -x listusers
In windows we have Robocop similar in Linux we have rsync
with rsync we can modify the destination directory to delete the files that are deleted from Source and add new files and update the files accordingly
rsync -zavnh --delete <<source>> <<destination>>
http://blog.powercram.com/2009/11/what-is-linux-equivalent-to-robocopy.html#:~:text=The%20Linux%20equivalent%20to%20Window%27s,file%20mirroring%20utility%20called%20rsync.
https://www.tecmint.com/rsync-local-remote-file-synchronization-commands/
https://phoenixnap.com/kb/rsync-command-linux-examples
https://www.linuxtechi.com/rsync-command-examples-linux/
https://www.computerhope.com/unix/rsync.htm